fix: allow `bind:this` with dynamic type on inputs (#9713)

fixes #9709
pull/9715/head
Simon H 1 year ago committed by GitHub
parent 1fe0152dd4
commit f88895e955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: allow `bind:this` with dynamic type on inputs

@ -323,7 +323,7 @@ export const validation = {
);
}
if (parent.name === 'input') {
if (parent.name === 'input' && node.name !== 'this') {
const type = /** @type {import('#compiler').Attribute | undefined} */ (
parent.attributes.find((a) => a.type === 'Attribute' && a.name === 'type')
);

@ -0,0 +1,6 @@
<script>
let foo;
let inputType;
</script>
<input bind:this={foo} type={inputType}>
Loading…
Cancel
Save