diff --git a/src/input/ContentEditableInput.js b/src/input/ContentEditableInput.js
index <HASH>..<HASH> 100644
--- a/src/input/ContentEditableInput.js
+++ b/src/input/ContentEditableInput.js
@@ -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
   }
Fix DOM selection update in contenteditable mode when another window has focus

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

Issue #<I>