mirror of
https://github.com/codex-team/editor.js
synced 2024-05-04 15:43:22 +02:00
fix(caret): caret loosing on mobile devices (#2570)
* fix(caret): caret loosing on mobile devices * rm unused import
This commit is contained in:
parent
cd29c52e51
commit
11925ca980
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue