mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 21:05:36 +00:00
Bug 303928: Tabbing or arrowing off autocomplete closes selection and location shows last selected entry, patch by Simon B�nzli <zeniko@gmail.com>, r=mconnor
This commit is contained in:
parent
6bcd26663d
commit
ff647353fe
@ -462,6 +462,14 @@
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="_focus"> <!-- doesn't reset this.mController -->
|
||||
<body><![CDATA[
|
||||
this._dontBlur = true;
|
||||
this.focus();
|
||||
this._dontBlur = false;
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
</implementation>
|
||||
|
||||
<handlers>
|
||||
@ -481,7 +489,7 @@
|
||||
action="this.attachController();"/>
|
||||
|
||||
<handler event="blur" phase="capturing"
|
||||
action="this.detachController();"/>
|
||||
action="if (!this._dontBlur) this.detachController();"/>
|
||||
|
||||
</handlers>
|
||||
</binding>
|
||||
@ -582,12 +590,9 @@
|
||||
<body><![CDATA[
|
||||
try {
|
||||
var amount = aPage ? 5 : 1;
|
||||
var selectedIndex = this.getNextIndex(aReverse, amount, this.selectedIndex, this.tree.view.rowCount-1);
|
||||
if (selectedIndex != -1) {
|
||||
this.selectedIndex = selectedIndex;
|
||||
}
|
||||
else {
|
||||
this.input.focus();
|
||||
this.selectedIndex = this.getNextIndex(aReverse, amount, this.selectedIndex, this.tree.view.rowCount-1);
|
||||
if (this.selectedIndex == -1) {
|
||||
this.input._focus();
|
||||
}
|
||||
} catch (ex) {
|
||||
// do nothing - occasionally timer-related js errors happen here
|
||||
|
Loading…
Reference in New Issue
Block a user