Bug 415791 - Page scrolls to the focused element when closing panels. r=enn

This commit is contained in:
Dão Gottwald 2009-06-15 20:38:25 +02:00
Родитель d430acae31
Коммит f33954db70
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

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