mirror of
https://github.com/codex-team/editor.js
synced 2024-06-09 09:22:16 +02:00
Add a check that allows inline toolboxes to work with nested editorsjs
This commit is contained in:
parent
c5ddf91189
commit
3c335f826d
|
@ -820,9 +820,13 @@ export default class UI extends Module<UINodes> {
|
|||
|
||||
/**
|
||||
* Event can be fired on clicks at non-block-content elements,
|
||||
* for example, at the Inline Toolbar or some Block Tune element
|
||||
* for example, at the Inline Toolbar or some Block Tune element.
|
||||
* We also make sure that the closest block belongs to the current editor and not a parent
|
||||
*/
|
||||
const clickedOutsideBlockContent = focusedElement.closest(`.${Block.CSS.content}`) === null;
|
||||
const closestBlock = focusedElement.closest(`.${Block.CSS.content}`);
|
||||
const clickedOutsideBlockContent =
|
||||
closestBlock === null
|
||||
|| (closestBlock.closest(`.${Selection.CSS.editorWrapper}`) !== this.nodes.wrapper);
|
||||
|
||||
if (clickedOutsideBlockContent) {
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue