This commit is contained in:
lucas lelievre 2024-05-02 03:29:13 -07:00 committed by GitHub
commit a002c32d08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View file

@ -29,7 +29,8 @@
"tools:update": "yarn _tools:checkout && yarn _tools:pull && yarn _tools:make",
"test:e2e": "yarn build:test && cypress run",
"test:e2e:open": "yarn build:test && cypress open",
"devserver:start": "yarn build && node ./devserver.js"
"devserver:start": "yarn build && node ./devserver.js",
"prepare": "npm run build"
},
"author": "CodeX",
"license": "Apache-2.0",
@ -75,5 +76,8 @@
"collective": {
"type": "opencollective",
"url": "https://opencollective.com/editorjs"
},
"dependencies": {
"yarn": "^1.22.21"
}
}

View file

@ -841,9 +841,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) {
/**