Skip to content

Commit fc3d7cd

Browse files
committed
fix: work around IE/Edge bug when accessing document.activeElement from iframe
close #6157
1 parent eb9168c commit fc3d7cd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/platforms/web/runtime/modules/dom-props.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ function shouldUpdateValue (
6363
function isDirty (elm: acceptValueElm, checkVal: string): boolean {
6464
// return true when textbox (.number and .trim) loses focus and its value is
6565
// not equal to the updated value
66-
return document.activeElement !== elm && elm.value !== checkVal
66+
let notInFocus = true
67+
// #6157
68+
// work around IE bug when accessing document.activeElement in an iframe
69+
try { notInFocus = document.activeElement !== elm } catch (e) {}
70+
return notInFocus && elm.value !== checkVal
6771
}
6872

6973
function isInputChanged (elm: any, newVal: string): boolean {

0 commit comments

Comments
 (0)