зеркало из https://github.com/mozilla/gecko-dev.git
Bug 415791 - Page scrolls to the focused element when closing panels. r=enn
This commit is contained in:
Родитель
d430acae31
Коммит
f33954db70
|
@ -253,7 +253,13 @@
|
|||
if (currentFocus == this) {
|
||||
// Focus was set on an element inside this panel,
|
||||
// so we need to move it back to where it was previously
|
||||
prevFocus.focus();
|
||||
try {
|
||||
let fm = Components.classes["@mozilla.org/focus-manager;1"]
|
||||
.getService(Components.interfaces.nsIFocusManager);
|
||||
fm.setFocus(prevFocus, fm.FLAG_NOSCROLL);
|
||||
} catch(e) {
|
||||
prevFocus.focus();
|
||||
}
|
||||
return;
|
||||
}
|
||||
currentFocus = currentFocus.parentNode;
|
||||
|
|
Загрузка…
Ссылка в новой задаче