From fac3910d28a6e3be50593fa91660e495679ebcd9 Mon Sep 17 00:00:00 2001 From: Ben Clark Date: Thu, 21 Dec 2023 11:54:15 -0500 Subject: [PATCH] Fix #1265 by only autofocusing the preset search input for new features, and also clearing the input after a selection. (#1267) --- modules/ui/inspector.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/ui/inspector.js b/modules/ui/inspector.js index 185851198b..0335b5ac7d 100644 --- a/modules/ui/inspector.js +++ b/modules/ui/inspector.js @@ -140,9 +140,9 @@ export function uiInspector(context) { presetList.selected(selected); } - // render + // render and autofocus only if the feature is new. presetPane - .call(presetList.autofocus(true)); + .call(presetList.autofocus(_newFeature)); }; @@ -179,6 +179,8 @@ export function uiInspector(context) { inspector.showPresetList(); } else { const choice = preset ? [preset] : null; + const input = presetPane.select('.preset-search-input').node(); + input.value = ''; inspector.showEntityEditor(choice, true); // true = animate } };