Bug 1925532: Enter search mode without preview mode by key if there is single result r=daleharvey

Differential Revision: https://phabricator.services.mozilla.com/D226865
This commit is contained in:
Daisuke Akatsuka
2024-11-11 22:19:45 +00:00
parent 3c26095a38
commit 708d0195d5
3 changed files with 115 additions and 37 deletions

View File

@@ -1511,11 +1511,17 @@ export class UrlbarInput {
let enteredSearchMode;
// Only preview search mode if the result is selected.
if (this.view.resultIsSelected(result)) {
// Not starting a query means we will only preview search mode.
// For ScotchBonnet, As Tab and Arrow Down/Up, Page Down/Up key are used
// for selection of the urlbar results, keep the search mode as preview
// mode if there are multiple results.
// If ScotchBonnet is disabled, not starting a query means we will only
// preview search mode.
enteredSearchMode = this.maybeConfirmSearchModeFromResult({
result,
checkValue: false,
startQuery: false,
startQuery:
lazy.UrlbarPrefs.get("scotchBonnet.enableOverride") &&
this.view.visibleResults.length == 1,
});
}
if (!enteredSearchMode) {