diff --git a/src/generators/nodes/Attribute.ts b/src/generators/nodes/Attribute.ts index 57b387d20b..90031d261e 100644 --- a/src/generators/nodes/Attribute.ts +++ b/src/generators/nodes/Attribute.ts @@ -518,7 +518,6 @@ const attributeLookup = { type: { appliesTo: [ 'button', - 'input', 'command', 'embed', 'object', diff --git a/test/js/samples/input-without-blowback-guard/expected-bundle.js b/test/js/samples/input-without-blowback-guard/expected-bundle.js index 0b5089c08d..2e27d4c2bc 100644 --- a/test/js/samples/input-without-blowback-guard/expected-bundle.js +++ b/test/js/samples/input-without-blowback-guard/expected-bundle.js @@ -33,6 +33,10 @@ function removeListener(node, event, handler) { node.removeEventListener(event, handler, false); } +function setAttribute(node, attribute, value) { + node.setAttribute(attribute, value); +} + function blankObject() { return Object.create(null); } @@ -206,7 +210,7 @@ function create_main_fragment(component, state) { h: function hydrate() { addListener(input, "change", input_change_handler); - input.type = "checkbox"; + setAttribute(input, "type", "checkbox"); }, m: function mount(target, anchor) { diff --git a/test/js/samples/input-without-blowback-guard/expected.js b/test/js/samples/input-without-blowback-guard/expected.js index 307a26c53c..ba99db4541 100644 --- a/test/js/samples/input-without-blowback-guard/expected.js +++ b/test/js/samples/input-without-blowback-guard/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { addListener, assign, createElement, detachNode, init, insertNode, proto, removeListener } from "svelte/shared.js"; +import { addListener, assign, createElement, detachNode, init, insertNode, proto, removeListener, setAttribute } from "svelte/shared.js"; function create_main_fragment(component, state) { var input; @@ -16,7 +16,7 @@ function create_main_fragment(component, state) { h: function hydrate() { addListener(input, "change", input_change_handler); - input.type = "checkbox"; + setAttribute(input, "type", "checkbox"); }, m: function mount(target, anchor) {