diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index f8ec366c..644369ce 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -14,6 +14,7 @@ - `Fix` — `blocks.render()` won't lead the `onChange` call in Safari - `Fix` — Editor wrapper element growing on the Inline Toolbar close - `Fix` — Fix errors thrown by clicks on a document when the editor is being initialized +- `Fix` — Caret losing on Mobile Devices when adding a block via Toolbox or via Backspace at the beginning of a Block - `Improvement` — Now you can set focus via arrows/Tab to "contentless" (decorative) blocks like Delimiter which have no inputs. - `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. - `Refactoring` — `ce-block--focused` class toggling removed as unused. diff --git a/src/components/modules/caret.ts b/src/components/modules/caret.ts index 0726293c..425c8d5e 100644 --- a/src/components/modules/caret.ts +++ b/src/components/modules/caret.ts @@ -11,7 +11,6 @@ import Selection from '../selection'; import Module from '../__module'; import Block from '../block'; import $ from '../dom'; -import * as _ from '../utils'; /** * @typedef {Caret} Caret @@ -297,13 +296,7 @@ export default class Caret extends Module { break; } - /** - * @todo try to fix via Promises or use querySelectorAll to not to use timeout - */ - _.delay(() => { - this.set(nodeToSet as HTMLElement, offset); - // eslint-disable-next-line @typescript-eslint/no-magic-numbers - }, 20)(); + this.set(nodeToSet as HTMLElement, offset); BlockManager.setCurrentBlockByChildNode(block.holder); BlockManager.currentBlock.currentInput = element;