use setAttribute with inputs, for benefit of IE - fixes #1209

pull/1237/head
Rich Harris 7 years ago
parent 0ac77019d0
commit 4e99eb8d37

@ -518,7 +518,6 @@ const attributeLookup = {
type: { type: {
appliesTo: [ appliesTo: [
'button', 'button',
'input',
'command', 'command',
'embed', 'embed',
'object', 'object',

@ -33,6 +33,10 @@ function removeListener(node, event, handler) {
node.removeEventListener(event, handler, false); node.removeEventListener(event, handler, false);
} }
function setAttribute(node, attribute, value) {
node.setAttribute(attribute, value);
}
function blankObject() { function blankObject() {
return Object.create(null); return Object.create(null);
} }
@ -206,7 +210,7 @@ function create_main_fragment(component, state) {
h: function hydrate() { h: function hydrate() {
addListener(input, "change", input_change_handler); addListener(input, "change", input_change_handler);
input.type = "checkbox"; setAttribute(input, "type", "checkbox");
}, },
m: function mount(target, anchor) { m: function mount(target, anchor) {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* 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) { function create_main_fragment(component, state) {
var input; var input;
@ -16,7 +16,7 @@ function create_main_fragment(component, state) {
h: function hydrate() { h: function hydrate() {
addListener(input, "change", input_change_handler); addListener(input, "change", input_change_handler);
input.type = "checkbox"; setAttribute(input, "type", "checkbox");
}, },
m: function mount(target, anchor) { m: function mount(target, anchor) {

Loading…
Cancel
Save