Skip to content
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

Clear highlights and pointer on BlockManager even if selection was inside of the editor before clicking outside #2644

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

VikhorKonstantin
Copy link
Contributor

Fix: #2643

Clear highlights and pointer on BlockManager even if selection was inside of the editor before clicking outside

@@ -620,7 +620,7 @@ export default class UI extends Module<UINodes> {
* Do not fire check on clicks at the Inline Toolbar buttons
*/
const target = event.target as HTMLElement;
const clickedInsideOfEditor = this.nodes.holder.contains(target) || Selection.isAtEditor;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember why it was added. Anyway, I've tested it and it looks like everything is ok. So please add a test (at the Ui.cy.ts) and a change log

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neSpecc, I just tried to write some tests and encountered an issue with the ui.ts:documentClicked function:
image
It appears that this check causes clicks made by Cypress click() to behave differently from user-generated clicks (because Cypress-generated clicks will always have isTrusted == false). I'm concerned that this might break other tests as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neSpecc, I've commented this out with an explanation in a comment. Seems like we're not triggering Click events anywhere in the code so it shouldn't break anything.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've found a bug with Block Tunes pressing by Enter. It sometimes removes the block itself (like Enter pressed when block is selected). It can be reproduces in the next so I'm gonna dig in it soon.

They can be related

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @VikhorKonstantin. I've resolved several problems with Enter press. Please, pull the next and check if the problem still actual

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants