Bug 823990 - Autocomplete results should not disappear for no results when minResults == 0. r=mak
This commit is contained in:
@@ -587,8 +587,12 @@ nsAutoCompleteController::HandleDelete(bool *_retval)
|
|||||||
// Nothing left in the popup, clear any pending search timers and
|
// Nothing left in the popup, clear any pending search timers and
|
||||||
// close the popup.
|
// close the popup.
|
||||||
ClearSearchTimer();
|
ClearSearchTimer();
|
||||||
|
uint32_t minResults;
|
||||||
|
input->GetMinResultsForPopup(&minResults);
|
||||||
|
if (minResults) {
|
||||||
ClosePopup();
|
ClosePopup();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@@ -1344,10 +1348,13 @@ nsAutoCompleteController::ProcessResult(int32_t aSearchIndex, nsIAutoCompleteRes
|
|||||||
NS_ENSURE_TRUE(popup != nullptr, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(popup != nullptr, NS_ERROR_FAILURE);
|
||||||
popup->Invalidate();
|
popup->Invalidate();
|
||||||
|
|
||||||
|
uint32_t minResults;
|
||||||
|
input->GetMinResultsForPopup(&minResults);
|
||||||
|
|
||||||
// Make sure the popup is open, if necessary, since we now have at least one
|
// Make sure the popup is open, if necessary, since we now have at least one
|
||||||
// search result ready to display. Don't force the popup closed if we might
|
// search result ready to display. Don't force the popup closed if we might
|
||||||
// get results in the future to avoid unnecessarily canceling searches.
|
// get results in the future to avoid unnecessarily canceling searches.
|
||||||
if (mRowCount) {
|
if (mRowCount || !minResults) {
|
||||||
OpenPopup();
|
OpenPopup();
|
||||||
} else if (result != nsIAutoCompleteResult::RESULT_NOMATCH_ONGOING) {
|
} else if (result != nsIAutoCompleteResult::RESULT_NOMATCH_ONGOING) {
|
||||||
ClosePopup();
|
ClosePopup();
|
||||||
|
|||||||
Reference in New Issue
Block a user