mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 02:25:34 +00:00
Attempt to fix crashes using arrow-key scrolling in autocomplete. Bug 306067, r+sr=dbaron.
This commit is contained in:
parent
20f0378e89
commit
dd8f7f450f
@ -391,13 +391,15 @@ nsAutoCompleteController::HandleKeyNavigation(PRUint16 aKey, PRBool *_retval)
|
||||
PRBool page = aKey == nsIAutoCompleteController::KEY_PAGE_UP ||
|
||||
aKey == nsIAutoCompleteController::KEY_PAGE_DOWN ? PR_TRUE : PR_FALSE;
|
||||
|
||||
// Fill in the value of the textbox with whatever is selected in the popup
|
||||
// if the completeSelectedIndex attribute is set. We check this before
|
||||
// calling SelectBy since that can null out mInput in some cases.
|
||||
PRBool completeSelection;
|
||||
mInput->GetCompleteSelectedIndex(&completeSelection);
|
||||
|
||||
// Instruct the result view to scroll by the given amount and direction
|
||||
popup->SelectBy(reverse, page);
|
||||
|
||||
// Fill in the value of the textbox with whatever is selected in the popup
|
||||
// if the completeSelectedIndex attribute is set
|
||||
PRBool completeSelection;
|
||||
mInput->GetCompleteSelectedIndex(&completeSelection);
|
||||
if (completeSelection)
|
||||
{
|
||||
PRInt32 selectedIndex;
|
||||
|
Loading…
Reference in New Issue
Block a user