diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index d126e0e5290..977f8a04e2c 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -2671,6 +2671,7 @@ var FormAssistant = { // Used to keep track of the element that corresponds to the current // autocomplete suggestions _currentInputElement: null, + _uiBusy: false, init: function() { Services.obs.addObserver(this, "FormAssist:AutoComplete", false); @@ -2775,13 +2776,20 @@ var FormAssistant = { }, handleClick: function(aTarget) { + // if we're busy looking at a select we want to eat any clicks that + // come to us, but not to process them + if (this._uiBusy) + return true; + let target = aTarget; while (target) { if (this._isSelectElement(target) && !target.disabled) { + this._uiBusy = true; target.focus(); let list = this.getListForElement(target); this.show(list, target); target = null; + this._uiBusy = false; return true; } if (target) @@ -2834,6 +2842,9 @@ var FormAssistant = { disabled: aNode.disabled, id: aIndex } + if (result.listitems[aIndex].inGroup) + result.listitems[aIndex].disabled = result.listitems[aIndex].disabled || aNode.parentNode.disabled; + result.selected[aIndex] = aNode.selected; }); return result;