Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using svelte:element for a and button doesn't recognize disabled #1977

Closed
frederikhors opened this issue Apr 8, 2023 · 4 comments
Closed

Comments

@frederikhors
Copy link
Contributor

frederikhors commented Apr 8, 2023

Describe the bug

I do not understand what is Typescript complaining about for the disabled prop:

<script lang="ts">
	export let href: string | undefined = undefined;
</script>

<svelte:element
	this={href ? 'a' : 'button'}
	disabled={href ? undefined : true}
>
	Hello!
</svelte:element>
Argument of type '{ type: string | undefined; disabled: true | undefined; form: string | undefined; href: string | undefined; target: string | undefined; rel: string | undefined; id: string | undefined; ... 5 more ...; "on:focus": undefined; }' is not assignable to parameter of type 'HTMLProps<"a", HTMLAttributes<any>> | HTMLProps<"button", HTMLAttributes<any>>'.
  Object literal may only specify known properties, and '"disabled"' does not exist in type 'HTMLProps<"a", HTMLAttributes<any>>'.ts(2345)

System Info

"typescript": "5.0.4"

Which package is the issue about?

svelte-check

@frederikhors frederikhors added the bug Something isn't working label Apr 8, 2023
@jasonlyu123 jasonlyu123 removed the bug Something isn't working label Apr 9, 2023
@jasonlyu123
Copy link
Member

I can't reproduce this with the latest version. Can you provide a reproduction repository?

@frederikhors
Copy link
Contributor Author

Is there a REPL for Svelte & Typescript?

@jasonlyu123
Copy link
Member

No

@dummdidumm
Copy link
Member

Closing due to inactivity and lack of reproduction

@dummdidumm dummdidumm closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants