-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
$props is not defined
thrown with dynamic type-attribute "workaround"
#4368
Comments
Why do you even update const onInput = e => {
value = e.target.value;
}; Should be enough. But I have to admit that it is a bit strange that its "allowed" to fetch properties from |
I honestly have no idea. I just looked up a solution to a problem in a somewhat popular Svelte UI library and found that it throws errors on each keystroke. But you seem to be correct, it works without the The fact that this code used to work in |
It appears that as of 3.10.1, assignments to I'm undecided on whether we should allow changing |
I'm putting off deciding what should happen when assigning to |
Prologue
With Svelte, it's somewhat cumbersome to create a typical
<TextField>
or<Input>
-component with a dynamic attribute fortype
.A workaround is required to get two-way bindings working, and the first one I found was the one being used at c0bra/svelma:
Describe the bug
The pattern described above worked fine in Svelte
3.10.0
and earlier, but with3.10.1
and later, an error is thrown on everyinput
-event:The value binding seems to work regardless, though.
To Reproduce
I took the
<Input>
-component from Svelma and tweaked it a tiny bit to get it running in the REPL:(Broken with 3.18.1)
https://svelte.dev/repl/e84cf43befae4309927fad538078fd30?version=3.18.1
(Broken with 3.10.1)
https://svelte.dev/repl/e84cf43befae4309927fad538078fd30?version=3.10.1
(Working with 3.10.0)
https://svelte.dev/repl/e84cf43befae4309927fad538078fd30?version=3.10.0
Expected behavior
I'd expect not to get any errors, or a nicer, Sveltier way to achieve dynamic type-attributes.
Severity
Given how annoying it is to work around the dynamic type-attribute limitation, and then the workaround doesn't work, it definitely doubles the annoyance, if not triples?
The text was updated successfully, but these errors were encountered: