fix(caret): caret loosing on mobile devices

This commit is contained in:
Peter Savchenko 2023-12-22 22:33:46 +03:00
parent ea2be754e7
commit fdffc5cbfc
No known key found for this signature in database
GPG key ID: E68306B1AB0F727C
2 changed files with 2 additions and 7 deletions

View file

@ -11,6 +11,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
- `Fix` — 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.
### 2.28.2

View file

@ -255,13 +255,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;