File tree 3 files changed +14
-7
lines changed
3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
12
12
mapPlainTextIndex ,
13
13
readConfigFromChildren ,
14
14
spliceString ,
15
+ isIE ,
15
16
isNumber ,
16
17
keys ,
17
18
omit ,
@@ -471,13 +472,15 @@ class MentionsInput extends React.Component {
471
472
// Handle input element's change event
472
473
handleChange = ( ev ) => {
473
474
isComposing = false
474
- // if we are inside iframe, we need to find activeElement within its contentDocument
475
- const currentDocument =
476
- ( document . activeElement && document . activeElement . contentDocument ) ||
477
- document
478
- if ( currentDocument . activeElement !== ev . target ) {
479
- // fix an IE bug (blur from empty input element with placeholder attribute trigger "input" event)
480
- return
475
+ if ( isIE ( ) ) {
476
+ // if we are inside iframe, we need to find activeElement within its contentDocument
477
+ const currentDocument =
478
+ ( document . activeElement && document . activeElement . contentDocument ) ||
479
+ document
480
+ if ( currentDocument . activeElement !== ev . target ) {
481
+ // fix an IE bug (blur from empty input element with placeholder attribute trigger "input" event)
482
+ return
483
+ }
481
484
}
482
485
483
486
const value = this . props . value || ''
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export { default as spliceString } from './spliceString'
14
14
export { default as makeMentionsMarkup } from './makeMentionsMarkup'
15
15
export { default as iterateMentionsMarkup } from './iterateMentionsMarkup'
16
16
export { default as getSubstringIndex } from './getSubstringIndex'
17
+ export { default as isIE } from './isIE'
17
18
export { default as isNumber } from './isNumber'
18
19
export { default as merge } from './merge'
19
20
export { default as omit } from './omit'
Original file line number Diff line number Diff line change
1
+ const isIE = ( ) => ! ! document . documentMode
2
+
3
+ export default isIE
You can’t perform that action at this time.
0 commit comments