Fix focus hijacking issue in nested List

This commit is contained in:
Ian Gulliver
2019-06-20 23:33:07 +00:00
parent c223945147
commit 2b65688277

View File

@@ -171,9 +171,10 @@ class List {
class NodeList extends List {
constructor(container) {
super(container);
this.container_.tabIndex = 0;
// Needs to accept focus to receive keydown, but shouldn't be in the normal
// tab flow.
this.container_.tabIndex = 99999;
this.container_.addEventListener('keydown', e => { this.onKeyDown(e); });
this.container_.addEventListener('focus', e => { this.onFocus(); });
}
addNodeAfter() {
@@ -201,10 +202,6 @@ class NodeList extends List {
super.onKeyDown(e);
}
onFocus() {
this.selectNext();
}
}
class Editor extends List {