-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent duplicated event dispatching #1381
Prevent duplicated event dispatching #1381
Conversation
00874d6
to
55acc92
Compare
@@ -185,7 +185,6 @@ export default class Core { | |||
a: true, | |||
} as SanitizerConfig; | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarn lint:fix
@@ -175,7 +175,7 @@ export default class BlockSelection extends Module { | |||
* | |||
* Prevent such actions if focus is not inside the Editor | |||
*/ | |||
if (!BlockManager.currentBlock) { | |||
if (!event.target.closest(`.${this.Editor.UI.CSS.editorWrapper}`)?.isEqualNode(this.Editor.UI.nodes.wrapper)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When multiple Editor.js instances are launched, BlockManager.currentBlock
can't be changed to null by focusing other instances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it makes sense to create a function inside UI module that gets event and checks if event's target is under editor's instance wrapper?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, this method seems DOM hacking!
Sorry, this problem has been resolved by #1431
) { | ||
return; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And... This fix is also already resolved in next
.
This PR is invalid.
Sorry, I'll close it!
These fixes are resolved by #1431 |
#1174