mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 18:55:30 +00:00
Bug 1583535 - The Megabar should not expand when auto-focused after a panel is closed. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D48114 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
a566f56c8b
commit
0733410a0c
@ -1801,6 +1801,8 @@ class UrlbarInput {
|
||||
// We handle mouse-based expansion events separately in _on_click.
|
||||
if (this._focusedViaMousedown) {
|
||||
this._focusedViaMousedown = false;
|
||||
} else if (this.inputField.hasAttribute("refocused-by-panel")) {
|
||||
this._maybeSelectAll(true);
|
||||
} else {
|
||||
this.startLayoutExtend();
|
||||
}
|
||||
|
@ -255,13 +255,17 @@
|
||||
|
||||
function doFocus() {
|
||||
// Focus was set on an element inside this panel,
|
||||
// so we need to move it back to where it was previously
|
||||
// so we need to move it back to where it was previously.
|
||||
// Elements can use refocused-by-panel to change their focus behaviour
|
||||
// when re-focused by a panel hiding.
|
||||
prevFocus.setAttribute("refocused-by-panel", true);
|
||||
try {
|
||||
let fm = Services.focus;
|
||||
fm.setFocus(prevFocus, fm.FLAG_NOSCROLL);
|
||||
} catch (e) {
|
||||
prevFocus.focus();
|
||||
}
|
||||
prevFocus.removeAttribute("refocused-by-panel");
|
||||
}
|
||||
var currentFocus = this._currentFocus;
|
||||
var prevFocus = this._prevFocus ? this._prevFocus.get() : null;
|
||||
|
Loading…
Reference in New Issue
Block a user