Skip to content

Commit

Permalink
fix: work around IE/Edge bug when accessing document.activeElement fr…
Browse files Browse the repository at this point in the history
…om iframe

close #6157
  • Loading branch information
yyx990803 committed Jul 21, 2017
1 parent eb9168c commit fc3d7cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/platforms/web/runtime/modules/dom-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ function shouldUpdateValue (
function isDirty (elm: acceptValueElm, checkVal: string): boolean {
// return true when textbox (.number and .trim) loses focus and its value is
// not equal to the updated value
return document.activeElement !== elm && elm.value !== checkVal
let notInFocus = true
// #6157
// work around IE bug when accessing document.activeElement in an iframe
try { notInFocus = document.activeElement !== elm } catch (e) {}
return notInFocus && elm.value !== checkVal
}

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

0 comments on commit fc3d7cd

Please sign in to comment.