Clear highlights and pointer on BlockManager even if selection was inside of the editor before clicking outside#2644
Conversation
…side of the editor before clicking outside
| * 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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
@neSpecc, I just tried to write some tests and encountered an issue with the ui.ts:documentClicked function:

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.
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Hey @VikhorKonstantin. I've resolved several problems with Enter press. Please, pull the next and check if the problem still actual
…is always 'false' for Cypress-generated clicks
…licked outside of the editor
Fix: #2643
Clear highlights and pointer on BlockManager even if selection was inside of the editor before clicking outside