From fdf2985adfc33e7c85f4e087f5741a7bedadebf0 Mon Sep 17 00:00:00 2001 From: Tetsuro Yoshikawa Date: Thu, 9 Feb 2017 22:27:55 +0900 Subject: [PATCH] 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. --- mithril.js | 5 +++++ mithril.min.js | 24 ++++++++++++------------ render/render.js | 5 +++++ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/mithril.js b/mithril.js index c1ec91f0..cf18e1ac 100644 --- a/mithril.js +++ b/mithril.js @@ -773,6 +773,11 @@ var coreRenderer = function($window) { if (vnode.tag === "select" && key2 === "value" && vnode.dom.value === value && vnode.dom === $doc.activeElement) return //setting option[value] to same value while having select open blinks select dropdown in Chrome if (vnode.tag === "option" && key2 === "value" && vnode.dom.value === value) return + // If you assign an input type1 that is not supported by IE 11 with an assignment expression, an error0 will occur. + if (vnode.tag === "input" && key2 === "type") { + element.setAttribute(key2, value); + return + } element[key2] = value } else { diff --git a/mithril.min.js b/mithril.min.js index 528305de..8e7cd361 100644 --- a/mithril.min.js +++ b/mithril.min.js @@ -23,20 +23,20 @@ v))}A--}else q--,A--;if(A