Bug 1520326 - Set context.preselected when the first result is the heuristic result, regardless of result.defaultIndex. r=mak

Differential Revision: https://phabricator.services.mozilla.com/D16607

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Drew Willcoxon 2019-01-16 16:26:52 +00:00
parent 0f0796c9c5
commit 3d298e0ecf

View File

@ -194,8 +194,8 @@ function convertResultToMatches(context, result, urls) {
}
matches.push(match);
// Manage autofill and preselected properties for the first match.
if (i == 0 && result.defaultIndex == 0) {
if (style.includes("autofill")) {
if (i == 0) {
if (style.includes("autofill") && result.defaultIndex == 0) {
context.autofill = true;
}
if (style.includes("heuristic")) {