Bug 1490366 - Part 3: Select the first item in richlistbox on focus r=dao
☠☠ backed out by 45299a26e20a ☠ ☠
authorMark Striemer <mstriemer@mozilla.com>
Sun, 14 Oct 2018 15:13:52 +0000
changeset 441180 0b8bcd97f254
parent 441179 448672780572
child 441181 556f31a5e223
push id70950
push usermstriemer@mozilla.com
push dateSun, 14 Oct 2018 15:19:32 +0000
treeherderautoland@0b8bcd97f254 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1490366
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1490366 - Part 3: Select the first item in richlistbox on focus r=dao Differential Revision: https://phabricator.services.mozilla.com/D8282
toolkit/content/widgets/richlistbox.xml
--- a/toolkit/content/widgets/richlistbox.xml
+++ b/toolkit/content/widgets/richlistbox.xml
@@ -883,16 +883,20 @@
         ]]>
       </handler>
 
       <handler event="focus">
         <![CDATA[
           if (this.getRowCount() > 0) {
             if (this.currentIndex == -1) {
               this.currentIndex = this.getIndexOfFirstVisibleRow();
+              let currentItem = this.getItemAtIndex(this.currentIndex);
+              if (currentItem) {
+                this.selectItem(currentItem);
+              }
             } else {
               this.currentItem._fireEvent("DOMMenuItemActive");
             }
           }
           this._lastKeyTime = 0;
         ]]>
       </handler>