Make nodes selectable from the grid
This commit is contained in:
@@ -6,6 +6,7 @@ class EditorEntryBase extends ListenUtils {
|
||||
|
||||
this.elem_ = document.createElement('li');
|
||||
this.elem_.tabIndex = 0;
|
||||
this.elem_.id = 'entry' + idSource.getId();
|
||||
this.listen(this.elem_, 'focus', () => this.onElemFocus());
|
||||
this.listen(this.elem_, 'keydown', (e) => this.onKeyDown(e));
|
||||
|
||||
@@ -37,6 +38,10 @@ class EditorEntryBase extends ListenUtils {
|
||||
return this.elem_;
|
||||
}
|
||||
|
||||
getId() {
|
||||
return this.elem_.id;
|
||||
}
|
||||
|
||||
onElemFocus() {
|
||||
this.elem_.scrollIntoView({block: 'nearest'});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user