We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
bind:this
type
<input>
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
In Svelte 4, you could use bind:this with a dynamic type..
<script> let type = 'text'; let el; </script> <input {type} bind:this={el} />
but in Svelte 5 (runes or non-runes mode), this throws a compiler error: 'type' attribute must be a static text value if input uses two-way binding
'type' attribute must be a static text value if input uses two-way binding
This was explicitly checked and allowed in Svelte 4, so likely a regression.
index-a870eda6.js:83 CompileError: 'type' attribute must be a static text value if input uses two-way binding at sr ([email protected]:1:226153) at BindDirective ([email protected]:1:502150) at r ([email protected]:1:305770) at o ([email protected]:1:305833) at r ([email protected]:1:305770) at o ([email protected]:1:305833) at Object.next ([email protected]:1:112832) at r ([email protected]:1:305753) at next ([email protected]:1:305809) at _ ([email protected]:1:305020)
### System Info ```shell svelte: `5.0.0-next.15`
blocking an upgrade
The text was updated successfully, but these errors were encountered:
fix: allow bind:this with dynamic type on inputs
85a3215
fixes #9709
fix: allow bind:this with dynamic type on inputs (#9713)
f88895e
Successfully merging a pull request may close this issue.
Describe the bug
In Svelte 4, you could use
bind:this
with a dynamic type..but in Svelte 5 (runes or non-runes mode), this throws a compiler error:
'type' attribute must be a static text value if input uses two-way binding
This was explicitly checked and allowed in Svelte 4, so likely a regression.
Reproduction
Logs
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: