@@ -10,7 +10,7 @@ import { simpleSelection } from "../model/selection.js"
10
10
import { setSelection } from "../model/selection_updates.js"
11
11
import { getBidiPartAt , getOrder } from "../util/bidi.js"
12
12
import { android , chrome , gecko , ie_version } from "../util/browser.js"
13
- import { contains , range , removeChildrenAndAdd , selectInput } from "../util/dom.js"
13
+ import { activeElt , contains , range , removeChildrenAndAdd , selectInput } from "../util/dom.js"
14
14
import { on , signalDOMEvent } from "../util/event.js"
15
15
import { Delayed , lst , sel_dontScroll } from "../util/misc.js"
16
16
@@ -96,7 +96,7 @@ export default class ContentEditableInput {
96
96
let kludge = hiddenTextarea ( ) , te = kludge . firstChild
97
97
cm . display . lineSpace . insertBefore ( kludge , cm . display . lineSpace . firstChild )
98
98
te . value = lastCopied . text . join ( "\n" )
99
- let hadFocus = document . activeElement
99
+ let hadFocus = activeElt ( )
100
100
selectInput ( te )
101
101
setTimeout ( ( ) => {
102
102
cm . display . lineSpace . removeChild ( kludge )
@@ -119,7 +119,7 @@ export default class ContentEditableInput {
119
119
120
120
prepareSelection ( ) {
121
121
let result = prepareSelection ( this . cm , false )
122
- result . focus = document . activeElement == this . div
122
+ result . focus = activeElt ( ) == this . div
123
123
return result
124
124
}
125
125
@@ -213,7 +213,7 @@ export default class ContentEditableInput {
213
213
214
214
focus ( ) {
215
215
if ( this . cm . options . readOnly != "nocursor" ) {
216
- if ( ! this . selectionInEditor ( ) || document . activeElement != this . div )
216
+ if ( ! this . selectionInEditor ( ) || activeElt ( ) != this . div )
217
217
this . showSelection ( this . prepareSelection ( ) , true )
218
218
this . div . focus ( )
219
219
}
0 commit comments