mirror of
https://github.com/codex-team/editor.js
synced 2026-03-18 08:29:52 +01:00
Use activeElement if anchorNode is undefined (#1350)
This commit is contained in:
parent
a03007204a
commit
962d75abf2
2 changed files with 6 additions and 2 deletions
2
dist/editor.js
vendored
2
dist/editor.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -632,8 +632,12 @@ export default class Block {
|
|||
/**
|
||||
* If activeElement is native input, anchorNode points to its parent.
|
||||
* So if it is native input use it instead of anchorNode
|
||||
*
|
||||
* If anchorNode is undefined, also use activeElement
|
||||
*/
|
||||
this.currentInput = $.isNativeInput(document.activeElement) ? document.activeElement : SelectionUtils.anchorNode;
|
||||
this.currentInput = $.isNativeInput(document.activeElement) || !SelectionUtils.anchorNode
|
||||
? document.activeElement
|
||||
: SelectionUtils.anchorNode;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue