mirror of
https://github.com/codex-team/editor.js
synced 2024-06-26 09:20:07 +02:00
[issue-926]: fix dom iterator leafing when items are empty (#958)
* [issue-926]: fix dom iterator leafing when items are empty * update Changelog
This commit is contained in:
parent
d086b6daf9
commit
ea3c767d25
2
dist/editor.js
vendored
2
dist/editor.js
vendored
File diff suppressed because one or more lines are too long
|
@ -4,6 +4,7 @@
|
|||
|
||||
- `Improvements` — Inline Toolbar design improved
|
||||
- `Improvements` — Conversion Toolbar now included in the Inline Toolbar [#853](https://github.com/codex-team/editor.js/issues/853)
|
||||
— `Fix` — Fix flipper with empty dom iterator [#926](https://github.com/codex-team/editor.js/issues/926)
|
||||
|
||||
### 2.15.1
|
||||
|
||||
|
|
|
@ -96,6 +96,13 @@ export default class DomIterator {
|
|||
* @return {Number} index of focused node
|
||||
*/
|
||||
private leafNodesAndReturnIndex(direction: string): number {
|
||||
/**
|
||||
* if items is empty then there is nothing to leaf
|
||||
*/
|
||||
if (this.items.length === 0) {
|
||||
return this.cursor;
|
||||
}
|
||||
|
||||
let focusedButtonIndex = this.cursor;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue