Fix jump on CBS (#1732)

* Fix jump on CBS

* Fix lint
This commit is contained in:
George Berezhnoy 2021-07-21 22:12:13 +03:00 committed by GitHub
parent 9190824b1d
commit d2d18f8061
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -7,6 +7,7 @@
- `Fix` *Tunes API* - Tune config now passed to constructor under `config` property
- `Fix` *Types* - Add common type for internal and external Tools configuration
- `Fix` — Block's destroy method is called on block deletion
- `Fix` - Fix jump to the button of editor zone on CBS
### 2.22.1

View file

@ -662,6 +662,8 @@ export default class UI extends Module<UINodes> {
* - otherwise, add a new empty Block and set a Caret to that
*/
private redactorClicked(event: MouseEvent): void {
const { BlockSelection } = this.Editor;
if (!Selection.isCollapsed) {
return;
}
@ -689,7 +691,12 @@ export default class UI extends Module<UINodes> {
return;
}
const isClickedBottom = event.target instanceof Element && event.target.isEqualNode(this.nodes.redactor);
const isClickedBottom = event.target instanceof Element &&
event.target.isEqualNode(this.nodes.redactor) &&
/**
* If there is cross block selection started, target will be equal to redactor so we need additional check
*/
!BlockSelection.anyBlockSelected;
if (isClickedBottom) {
stopPropagation();