summaryrefslogtreecommitdiffstats
path: root/toolkit/components/autocomplete/nsAutoCompleteController.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /toolkit/components/autocomplete/nsAutoCompleteController.cpp
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/autocomplete/nsAutoCompleteController.cpp')
-rw-r--r--toolkit/components/autocomplete/nsAutoCompleteController.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/toolkit/components/autocomplete/nsAutoCompleteController.cpp b/toolkit/components/autocomplete/nsAutoCompleteController.cpp
index 126199e3cf..c8278f55a7 100644
--- a/toolkit/components/autocomplete/nsAutoCompleteController.cpp
+++ b/toolkit/components/autocomplete/nsAutoCompleteController.cpp
@@ -490,6 +490,13 @@ nsAutoCompleteController::HandleKeyNavigation(uint32_t aKey, bool* _retval) {
}
}
+ // Some script may have changed the value of the text field since our
+ // last keypress or after our focus handler and we don't want to
+ // search for a stale string.
+ nsAutoString value;
+ input->GetTextValue(value);
+ SetSearchStringInternal(value);
+
// Open the popup if there has been a previous non-errored search, or
// else kick off a new search
bool hadPreviousSearch = false;
@@ -522,13 +529,6 @@ nsAutoCompleteController::HandleKeyNavigation(uint32_t aKey, bool* _retval) {
return NS_OK;
}
- // Some script may have changed the value of the text field since our
- // last keypress or after our focus handler and we don't want to
- // search for a stale string.
- nsAutoString value;
- input->GetTextValue(value);
- SetSearchStringInternal(value);
-
StartSearches();
}
@@ -1235,6 +1235,8 @@ nsresult nsAutoCompleteController::EnterMatch(bool aIsPopupSelection,
SetSearchStringInternal(value);
}
+ popup->SelectEntry();
+
obsSvc->NotifyObservers(input, "autocomplete-did-enter-text", nullptr);
input->OnTextEntered(aEvent);