Skip to content

Commit 11925ca

Browse files
authored
fix(caret): caret loosing on mobile devices (#2570)
* fix(caret): caret loosing on mobile devices * rm unused import
1 parent cd29c52 commit 11925ca

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- `Fix``blocks.render()` won't lead the `onChange` call in Safari
1515
- `Fix` — Editor wrapper element growing on the Inline Toolbar close
1616
- `Fix` — Fix errors thrown by clicks on a document when the editor is being initialized
17+
- `Fix` — Caret losing on Mobile Devices when adding a block via Toolbox or via Backspace at the beginning of a Block
1718
- `Improvement` — Now you can set focus via arrows/Tab to "contentless" (decorative) blocks like Delimiter which have no inputs.
1819
- `Improvement` — Inline Toolbar sometimes opened in an incorrect position. Now it will be aligned by the left side of the selected text. And won't overflow the right side of the text column.
1920
- `Refactoring``ce-block--focused` class toggling removed as unused.

src/components/modules/caret.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import Selection from '../selection';
1111
import Module from '../__module';
1212
import Block from '../block';
1313
import $ from '../dom';
14-
import * as _ from '../utils';
1514

1615
/**
1716
* @typedef {Caret} Caret
@@ -297,13 +296,7 @@ export default class Caret extends Module {
297296
break;
298297
}
299298

300-
/**
301-
* @todo try to fix via Promises or use querySelectorAll to not to use timeout
302-
*/
303-
_.delay(() => {
304-
this.set(nodeToSet as HTMLElement, offset);
305-
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
306-
}, 20)();
299+
this.set(nodeToSet as HTMLElement, offset);
307300

308301
BlockManager.setCurrentBlockByChildNode(block.holder);
309302
BlockManager.currentBlock.currentInput = element;

0 commit comments

Comments
 (0)