Bug 1515759 - Revert in tree.xml the changes from bug 1508141. r=bgrins
authorRichard Marti <richard.marti@gmail.com>
Fri, 21 Dec 2018 19:39:22 +0100
changeset 451735 ddcc1ef993543f7bfb15e2d136c83fc721d54f09
parent 451734 4cb687d1228ec7fee6efe75380c14ef6920b7556
child 451736 d5f22f6c8de8c96d46679399d60b453f4d98d57c
push id35252
push userccoroiu@mozilla.com
push dateFri, 21 Dec 2018 21:56:22 +0000
treeherdermozilla-central@b23630094b9c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1515759, 1508141
milestone66.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 1515759 - Revert in tree.xml the changes from bug 1508141. r=bgrins
toolkit/content/widgets/tree.xml
--- a/toolkit/content/widgets/tree.xml
+++ b/toolkit/content/widgets/tree.xml
@@ -87,16 +87,21 @@
       <property name="inputField" readonly="true">
         <getter><![CDATA[
           if (!this._inputField)
             this._inputField = document.getAnonymousElementByAttribute(this, "anonid", "input");
           return this._inputField;
         ]]></getter>
       </property>
 
+     <property name="disableKeyNavigation"
+                onget="return this.hasAttribute('disableKeyNavigation');"
+                onset="if (val) this.setAttribute('disableKeyNavigation', 'true');
+                       else this.removeAttribute('disableKeyNavigation'); return val;"/>
+
       <field name="_editingRow">-1</field>
       <field name="_editingColumn">null</field>
 
       <property name="editingRow" readonly="true"
                 onget="return this._editingRow;"/>
       <property name="editingColumn" readonly="true"
                 onget="return this._editingColumn;"/>
 
@@ -859,17 +864,17 @@
 
          if (event.charCode == " ".charCodeAt(0)) {
            var c = this.currentIndex;
            if (!this.view.selection.isSelected(c) ||
                (!this.view.selection.single && event.getModifierState("Accel"))) {
              this.view.selection.toggleSelect(c);
              event.preventDefault();
            }
-         } else if (event.charCode > 0 &&
+         } else if (!this.disableKeyNavigation && event.charCode > 0 &&
                     !event.altKey && !event.getModifierState("Accel") &&
                     !event.metaKey && !event.ctrlKey) {
            var l = this._keyNavigate(event);
            if (l >= 0) {
              this.view.selection.timedSelect(l, this._selectDelay);
              this.treeBoxObject.ensureRowIsVisible(l);
            }
            event.preventDefault();