Skip to content

Commit fdf2985

Browse files
author
Tetsuro Yoshikawa
committed
Error in IE11 due to setting of type attribute
If you assign an input type that is not supported by IE11 with an assignment expression, an error will occur.
1 parent 5faa996 commit fdf2985

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

mithril.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,11 @@ var coreRenderer = function($window) {
773773
if (vnode.tag === "select" && key2 === "value" && vnode.dom.value === value && vnode.dom === $doc.activeElement) return
774774
//setting option[value] to same value while having select open blinks select dropdown in Chrome
775775
if (vnode.tag === "option" && key2 === "value" && vnode.dom.value === value) return
776+
// If you assign an input type1 that is not supported by IE 11 with an assignment expression, an error0 will occur.
777+
if (vnode.tag === "input" && key2 === "type") {
778+
element.setAttribute(key2, value);
779+
return
780+
}
776781
element[key2] = value
777782
}
778783
else {

mithril.min.js

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

render/render.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,11 @@ module.exports = function($window) {
443443
if (vnode.tag === "select" && key === "value" && vnode.dom.value === value && vnode.dom === $doc.activeElement) return
444444
//setting option[value] to same value while having select open blinks select dropdown in Chrome
445445
if (vnode.tag === "option" && key === "value" && vnode.dom.value === value) return
446+
// If you assign an input type that is not supported by IE 11 with an assignment expression, an error will occur.
447+
if (vnode.tag === "input" && key === "type") {
448+
element.setAttribute(key, value);
449+
return
450+
}
446451
element[key] = value
447452
}
448453
else {

0 commit comments

Comments
 (0)