Bug 255116: Pressing Home or Shift+Home should close the autocomplete dropdown, patch by Jesse Ruderman <jruderman@gmail.com>, r+a=mconnor

git-svn-id: svn://10.0.0.236/trunk@177634 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
gavin%gavinsharp.com
2005-08-12 03:41:14 +00:00
parent 21176a96c5
commit 594eaadf17
2 changed files with 10 additions and 3 deletions

View File

@@ -421,10 +421,14 @@ nsAutoCompleteController::HandleKeyNavigation(PRUint16 aKey, PRBool *_retval)
} else
StartSearchTimer();
}
} else if (aKey == nsIAutoCompleteController::KEY_LEFT ||
aKey == nsIAutoCompleteController::KEY_RIGHT)
} else if ( aKey == nsIAutoCompleteController::KEY_LEFT
|| aKey == nsIAutoCompleteController::KEY_RIGHT
#ifndef XP_MACOSX
|| aKey == nsIAutoCompleteController::KEY_HOME
#endif
)
{
// The user hit a left or right arrow key
// The user hit a text-navigation key.
PRBool isOpen;
mInput->GetPopupOpen(&isOpen);
if (isOpen) {

View File

@@ -380,6 +380,9 @@
case KeyEvent.DOM_VK_RIGHT:
cancel = this.mController.handleKeyNavigation(IController.KEY_RIGHT);
break;
case KeyEvent.DOM_VK_HOME:
cancel = this.mController.handleKeyNavigation(IController.KEY_HOME);
break;
case KeyEvent.DOM_VK_PAGE_UP:
cancel = this.mController.handleKeyNavigation(IController.KEY_PAGE_UP);
break;