Skip to content
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

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

Merged
merged 1 commit into from
Mar 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/generators/nodes/Attribute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ const attributeLookup = {
type: {
appliesTo: [
'button',
'input',
'command',
'embed',
'object',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/input-without-blowback-guard/expected.js
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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) {
Expand Down