Skip to content

Commit

Permalink
Fix loss of pointer (#666)
Browse files Browse the repository at this point in the history
* Fix loss of pointer when click is outside of the editor but selection is inside

* Remove log
  • Loading branch information
gohabereg authored Apr 5, 2019
1 parent 7d1ce59 commit a750894
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/editor.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 5 additions & 3 deletions src/components/modules/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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
*/
Expand Down

0 comments on commit a750894

Please sign in to comment.