Skip to content

Commit ce69182

Browse files
authored
Version 2.12.4 (codex-team#680)
* Do not start multi-block selection on UI elements (codex-team#662) * Do not start multi-block selection on UI elements * Do not prevent mousedown event on inline toolbar actions * Remove log * Add comment * Add link to issue closes codex-team#646 * Fix loss of pointer (codex-team#666) * Fix loss of pointer when click is outside of the editor but selection is inside * Remove log * Update shortcuts module (codex-team#685) * Fixed possible grammatical typo (codex-team#681) Thanks * Update shortcuts module * update changelog * update * Remove margin top for inline-link icon (codex-team#690) * Remove margin top for inline-link icon resolves codex-team#674 * Update CHANGELOG.md * Remove unused style * Pull fresh tools
1 parent bea4133 commit ce69182

File tree

15 files changed

+66
-44
lines changed

15 files changed

+66
-44
lines changed

dist/editor.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
# Changelog
22

3+
### 2.12.4
4+
5+
- `Improvements` CodeX.Shortcuts version updated to the v1.1 [#684](https://github.com/codex-team/editor.js/issues/684)
6+
- `Fix` — Do not start multi-block selection on Toolbox and Inline Toolbar [#646](https://github.com/codex-team/editor.js/issues/646)
7+
- `Fix` — Minor fixes of caret behaviour [#663](https://github.com/codex-team/editor.js/issues/663)
8+
- `Fix` — Fix inline-link icon position in Firefox [#674](https://github.com/codex-team/editor.js/issues/674)
9+
310
### 2.12.3
411

5-
- `Fix` — Make Toolbox tooltip position font-size independent
12+
- `Fix` — Make Toolbox tooltip position font-size independent
613

714
### 2.12.2
815

example/tools/list

Submodule list updated from 964edb4 to da8d692

example/tools/warning

Submodule warning updated 1 file

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@editorjs/editorjs",
3-
"version": "2.12.3",
3+
"version": "2.12.4",
44
"description": "Editor.js — Native JS, based on API and Open Source",
55
"main": "dist/editor.js",
66
"types": "./types/index.d.ts",
@@ -34,7 +34,7 @@
3434
"@babel/preset-env": "^7.3.4",
3535
"@babel/register": "^7.0.0",
3636
"@babel/runtime": "^7.3.4",
37-
"@codexteam/shortcuts": "^1.0.0",
37+
"@codexteam/shortcuts": "^1.1.1",
3838
"@types/webpack": "^4.4.25",
3939
"@types/webpack-env": "^1.13.9",
4040
"babel-loader": "^8.0.5",

src/components/modules/rectangleSelection.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,20 @@ export default class RectangleSelection extends Module {
137137
this.stackOfSelected = [];
138138

139139
const elemWhereSelectionStart = document.elementFromPoint(pageX - window.pageXOffset, pageY - window.pageYOffset);
140-
if (!(elemWhereSelectionStart.closest('.' + this.Editor.UI.CSS.editorWrapper) &&
141-
!elemWhereSelectionStart.closest('.' + Block.CSS.content))) {
140+
141+
const selectorsToAvoid = [
142+
`.${Block.CSS.content}`,
143+
`.${this.Editor.Toolbar.CSS.toolbar}`,
144+
`.${this.Editor.InlineToolbar.CSS.inlineToolbar}`,
145+
];
146+
147+
const startsInsideEditor = elemWhereSelectionStart.closest('.' + this.Editor.UI.CSS.editorWrapper);
148+
const startsInSelectorToAvoid = selectorsToAvoid.some(((selector) => !!elemWhereSelectionStart.closest(selector)));
149+
150+
/**
151+
* If selection starts outside of the editor or inside the blocks or on Editor UI elements, do not handle it
152+
*/
153+
if (!startsInsideEditor || startsInSelectorToAvoid) {
142154
return;
143155
}
144156

0 commit comments

Comments
 (0)