[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:
Murod Khaydarov 2019-11-30 14:10:37 +03:00 committed by GitHub
parent d086b6daf9
commit ea3c767d25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

2
dist/editor.js vendored

File diff suppressed because one or more lines are too long

View file

@ -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

View file

@ -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;
/**