Fix loss of pointer (#666)

* Fix loss of pointer when click is outside of the editor but selection is inside

* Remove log
This commit is contained in:
George Berezhnoy 2019-04-05 17:47:55 +03:00 committed by GitHub
commit a750894656
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

2
dist/editor.js vendored

File diff suppressed because one or more lines are too long

View file

@ -2,11 +2,12 @@
### 2.12.4
- `Fix` — Do not start multi-block selection on Toolbox and Inline Toolbar
- `Fix` — Do not start multi-block selection on Toolbox and Inline Toolbar [#646](https://github.com/codex-team/editor.js/issues/646)
- `Fix` — Minor fixes of caret behaviour [#663](https://github.com/codex-team/editor.js/issues/663)
### 2.12.3
- `Fix` — Make Toolbox tooltip position font-size independent [#646](https://github.com/codex-team/editor.js/issues/646)
- `Fix` — Make Toolbox tooltip position font-size independent
### 2.12.2

View file

@ -329,9 +329,9 @@ export default class UI extends Module {
*/
const target = event.target as HTMLElement;
const clickedOnInlineToolbarButton = target.closest(`.${this.Editor.InlineToolbar.CSS.inlineToolbar}`);
const clickedInsideofEditor = target.closest(`#${this.config.holderId}`);
const clickedInsideOfEditor = !!target.closest(`#${this.config.holderId}`) || Selection.isAtEditor;
if (!clickedInsideofEditor) {
if (!clickedInsideOfEditor) {
/**
* Clear highlightings and pointer on BlockManager
*
@ -348,7 +348,9 @@ export default class UI extends Module {
* Move inline toolbar to the focused Block
*/
this.Editor.InlineToolbar.handleShowingEvent(event);
} else if (Selection.isAtEditor) {
}
if (Selection.isAtEditor) {
/**
* Focus clicked Block
*/