From 14dba080b08fd4dd91d06e5715451dbb8c9825ea Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Mon, 20 Jan 2020 13:55:06 -0500 Subject: [PATCH] Fix inspector keytrap behavior --- modules/ui/entity_editor.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/modules/ui/entity_editor.js b/modules/ui/entity_editor.js index 5b23dffa9..b57a14a09 100644 --- a/modules/ui/entity_editor.js +++ b/modules/ui/entity_editor.js @@ -245,18 +245,15 @@ export function uiEntityEditor(context) { sectionEnter .append('input') .attr('type', 'text') - .attr('class', 'key-trap'); - }, - update: function(section) { - section.select('key-trap') + .attr('class', 'key-trap') .on('keydown.key-trap', function() { - // On tabbing, send focus back to the first field on the inspector-body - // (probably the `name` field) #4159 - if (d3_event.keyCode === 9 && !d3_event.shiftKey) { - d3_event.preventDefault(); - body.select('input').node().focus(); - } - }); + // On tabbing, send focus back to the first field on the inspector-body + // (probably the `name` field) #4159 + if (d3_event.keyCode === 9 && !d3_event.shiftKey) { + d3_event.preventDefault(); + body.select('input').node().focus(); + } + }); } } ];