Skip to content

Commit

Permalink
Fix DOM selection update in contenteditable mode when another window …
Browse files Browse the repository at this point in the history
…has focus

Refine the check for whether the editor has focus to look at
document.activeElement instead of state.focused.

Issue codemirror#6167
  • Loading branch information
marijnh committed Mar 9, 2020
1 parent 28568ba commit 856c3a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/input/ContentEditableInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default class ContentEditableInput {

prepareSelection() {
let result = prepareSelection(this.cm, false)
result.focus = this.cm.state.focused
result.focus = document.activeElement == this.div
return result
}

Expand Down

0 comments on commit 856c3a2

Please sign in to comment.