From 2b65688277f77652038dab4886cfbc10cd2ee110 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Thu, 20 Jun 2019 23:33:07 +0000 Subject: [PATCH] Fix focus hijacking issue in nested List --- architype.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/architype.js b/architype.js index 47539c0..af432c9 100644 --- a/architype.js +++ b/architype.js @@ -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 {