summaryrefslogtreecommitdiffstats
path: root/toolkit/content/widgets/menulist.xml
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/content/widgets/menulist.xml')
-rw-r--r--toolkit/content/widgets/menulist.xml18
1 files changed, 16 insertions, 2 deletions
diff --git a/toolkit/content/widgets/menulist.xml b/toolkit/content/widgets/menulist.xml
index ccdf3bd26..96c011809 100644
--- a/toolkit/content/widgets/menulist.xml
+++ b/toolkit/content/widgets/menulist.xml
@@ -129,8 +129,22 @@
<property name="label" readonly="true" onget="return this.getAttribute('label');"/>
<property name="description" onset="this.setAttribute('description',val); return val;"
onget="return this.getAttribute('description');"/>
- <property name="editable" onset="this.setAttribute('editable',val); return val;"
- onget="return this.getAttribute('editable') == 'true';"/>
+
+ <property name="editable" onget="return this.getAttribute('editable') == 'true';">
+ <setter>
+ <![CDATA[
+ if (!val && this.editable) {
+ // If we were focused and transition from editable to not editable,
+ // focus the parent menulist so that the focus does not get stuck.
+ if (this.inputField == document.activeElement)
+ window.setTimeout(() => this.focus(), 0);
+ }
+
+ this.setAttribute("editable", val);
+ return val;
+ ]]>
+ </setter>
+ </property>
<property name="open" onset="this.menuBoxObject.openMenu(val);
return val;"