Bug 1318203 - Follow-up, Void the search result whenever a login is confirmed, r=adw
MozReview-Commit-ID: LQwZeHh1LyT
--- a/toolkit/components/autocomplete/nsAutoCompleteController.cpp
+++ b/toolkit/components/autocomplete/nsAutoCompleteController.cpp
@@ -637,16 +637,19 @@ nsAutoCompleteController::HandleKeyNavig
input->SelectTextRange(value.Length(), value.Length());
}
}
}
// Close the pop-up even if nothing was selected
ClearSearchTimer();
ClosePopup();
+
+ // Void the current results as the input has changed.
+ ClearResults();
}
// Update last-searched string to the current input, since the input may
// have changed. Without this, subsequent backspaces look like text
// additions, not text deletions.
nsAutoString value;
input->GetTextValue(value);
mSearchString = value;
}
@@ -1551,16 +1554,19 @@ nsAutoCompleteController::EnterMatch(boo
SetTextValue(input, value, nsIAutoCompleteInput::TEXTVALUE_REASON_ENTERMATCH);
input->SelectTextRange(value.Length(), value.Length());
mSearchString = value;
}
obsSvc->NotifyObservers(input, "autocomplete-did-enter-text", nullptr);
ClosePopup();
+ // Void the current results as the input has changed.
+ ClearResults();
+
bool cancel;
input->OnTextEntered(aEvent, &cancel);
return NS_OK;
}
nsresult
nsAutoCompleteController::RevertTextValue()