mirror of
https://github.com/codex-team/editor.js
synced 2026-03-17 16:10:07 +01: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
3c5c26599f
commit
bbb47587dd
3 changed files with 10 additions and 3 deletions
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…
Add table
Add a link
Reference in a new issue