mirror of
https://github.com/codex-team/editor.js
synced 2024-05-17 22:06:49 +02:00
fix(interaction): problem with entering to Editor.js by Tab key (#1397)
* Fix problem with entering to Editor.js by Tab key * Optimize current block setting Co-authored-by: t.hata <hata@impact-blue.co.jp>
This commit is contained in:
parent
b134fccd1d
commit
113e895d20
2
dist/editor.js
vendored
2
dist/editor.js
vendored
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
|
||||
- `Fix` - The problem with destroy() method [#1380](https://github.com/codex-team/editor.js/issues/1380).
|
||||
- `Fix` - add getter keyword to `block.mergeable` method [#1415](https://github.com/codex-team/editor.js/issues/1415).
|
||||
|
||||
- `Fix` — Fix problem with entering to Editor.js by Tab key [#1393](https://github.com/codex-team/editor.js/issues/1393)
|
||||
|
||||
### 2.19
|
||||
|
||||
|
|
|
@ -726,7 +726,7 @@ export default class UI extends Module<UINodes> {
|
|||
*/
|
||||
private selectionChanged(event: Event): void {
|
||||
const { CrossBlockSelection, BlockSelection } = this.Editor;
|
||||
const focusedElement = Selection.anchorElement as Element;
|
||||
const focusedElement = Selection.anchorElement;
|
||||
|
||||
if (CrossBlockSelection.isCrossBlockSelectionStarted) {
|
||||
// Removes all ranges when any Block is selected
|
||||
|
@ -750,6 +750,13 @@ export default class UI extends Module<UINodes> {
|
|||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set current block when entering to Editor.js by tab key
|
||||
*/
|
||||
if (!this.Editor.BlockManager.currentBlock) {
|
||||
this.Editor.BlockManager.setCurrentBlockByChildNode(focusedElement);
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo add debounce
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue