hperrin / svelte-material-ui

Svelte Material UI Components
https://sveltematerialui.com/
Apache License 2.0
3.32k stars 285 forks source link

Textfield type error in v8-alpha #666

Open tomasz13nocon opened 1 month ago

tomasz13nocon commented 1 month ago

Describe the bug Binding value of Textfield on v8 alpha with svelte 5 makes Typescript complain: Type 'string | number | null' is not assignable to type 'string'.

To Reproduce

<script lang="ts">
    import Textfield from '@smui/textfield';
    let value = $state("");
</script>

<Textfield type="text" bind:value />

The only way for the error to go away is to define value as string | number | null which is undesirable.

Defining value as just string works just fine on v7 with svelte 4.