diff options
author | New Tobin Paradigm <email@mattatobin.com> | 2018-04-13 11:22:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-13 11:22:17 -0400 |
commit | c17c14ce6afc026e8b918b8bf48fba7515bebac3 (patch) | |
tree | 61f0bebf9a16479296d6cc9621c86ec23efa348e | |
parent | aedeefe89855b36da07a021a772cd02c37d6b887 (diff) | |
parent | 15e4dcdedd91421e10b80a83b63899439956911a (diff) | |
download | UXP-c17c14ce6afc026e8b918b8bf48fba7515bebac3.tar UXP-c17c14ce6afc026e8b918b8bf48fba7515bebac3.tar.gz UXP-c17c14ce6afc026e8b918b8bf48fba7515bebac3.tar.lz UXP-c17c14ce6afc026e8b918b8bf48fba7515bebac3.tar.xz UXP-c17c14ce6afc026e8b918b8bf48fba7515bebac3.zip |
Merge pull request #129 from janekptacijarabaci/_native_52ESR_xulWidgets_menulist_editable_1
Editable menulist loosing editable attribute gets focus stuck (menulist.xml)
-rw-r--r-- | toolkit/content/widgets/menulist.xml | 18 |
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;" |