Skip to content

Commit

Permalink
Fix #1265 by only autofocusing the preset search input for new featur…
Browse files Browse the repository at this point in the history
…es, and also clearing the input after a selection. (#1267)
  • Loading branch information
Bonkles authored Dec 21, 2023
1 parent 7a03cda commit fac3910
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/ui/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
};


Expand Down Expand Up @@ -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
}
};
Expand Down

0 comments on commit fac3910

Please sign in to comment.