mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
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:
commit
1bd5e897cb
1 changed files with 8 additions and 0 deletions
|
@ -25,6 +25,14 @@ function restoreOriginalValue() {
|
||||||
|
|
||||||
if (isSearchField(inputField) && originalQuery) {
|
if (isSearchField(inputField) && originalQuery) {
|
||||||
inputField.value = originalQuery;
|
inputField.value = originalQuery;
|
||||||
|
|
||||||
|
if (selectedTerm) {
|
||||||
|
const [, selectedTermEnd] = selectedTerm[0];
|
||||||
|
|
||||||
|
inputField.setSelectionRange(selectedTermEnd, selectedTermEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (originalTerm) {
|
if (originalTerm) {
|
||||||
|
|
Loading…
Reference in a new issue