Editable menulist loosing editable attribute gets focus stuck

Bug(s):
https://bugzilla.mozilla.org/show_bug.cgi?id=1142224
(native in moebius)
This commit is contained in:
janekptacijarabaci 2018-02-04 23:17:10 +01:00 committed by Roy Tam
commit e2fbb83e3a

View file

@ -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;"