Merge pull request #368 from koloml/fix-search-field-reset

Fixed resetting of the auto-completed query not working correctly
This commit is contained in:
liamwhite 2024-11-14 16:15:35 -05:00 committed by GitHub
commit 1bd5e897cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,6 +25,14 @@ function restoreOriginalValue() {
if (isSearchField(inputField) && originalQuery) {
inputField.value = originalQuery;
if (selectedTerm) {
const [, selectedTermEnd] = selectedTerm[0];
inputField.setSelectionRange(selectedTermEnd, selectedTermEnd);
}
return;
}
if (originalTerm) {