mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 06:35:42 +00:00
Bug 646015 - Update autocomplete suggestions as you type on device [r=mfinkle]
This commit is contained in:
parent
43daf24b79
commit
336377498c
@ -69,6 +69,11 @@ function FormAssistant() {
|
||||
addMessageListener("FormAssist:AutoComplete", this);
|
||||
addMessageListener("Content:SetWindowSize", this);
|
||||
|
||||
/* Listen text events in order to update the autocomplete suggestions as soon
|
||||
* a key is entered on device
|
||||
*/
|
||||
addEventListener("text", this, false);
|
||||
|
||||
addEventListener("keypress", this, true);
|
||||
addEventListener("keyup", this, false);
|
||||
addEventListener("focus", this, true);
|
||||
@ -331,6 +336,11 @@ FormAssistant.prototype = {
|
||||
this.currentIndex = focusedIndex;
|
||||
break;
|
||||
|
||||
case "text":
|
||||
if (this._isAutocomplete(aEvent.target))
|
||||
sendAsyncMessage("FormAssist:AutoComplete", this._getJSON());
|
||||
break;
|
||||
|
||||
// key processing inside a select element are done during the keypress
|
||||
// handler, preventing this one to be fired cancel the selection change
|
||||
case "keypress":
|
||||
|
Loading…
Reference in New Issue
Block a user