зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1573159 - Only call scrollIntoView() on login-list item if it isn't in view. r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D41886 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
0a772dbcbb
Коммит
d0b9568ea8
|
@ -473,7 +473,7 @@ export default class LoginList extends HTMLElement {
|
|||
this._list.setAttribute("aria-activedescendant", newlyFocusedItem.id);
|
||||
activeDescendant.classList.remove("keyboard-selected");
|
||||
newlyFocusedItem.classList.add("keyboard-selected");
|
||||
newlyFocusedItem.scrollIntoView(false);
|
||||
newlyFocusedItem.scrollIntoView({ block: "nearest" });
|
||||
}
|
||||
|
||||
_setListItemAsSelected(listItem) {
|
||||
|
@ -486,9 +486,11 @@ export default class LoginList extends HTMLElement {
|
|||
this._createLoginButton.disabled = !listItem.dataset.guid;
|
||||
listItem.classList.add("selected");
|
||||
listItem.setAttribute("aria-selected", "true");
|
||||
listItem.scrollIntoView();
|
||||
this._list.setAttribute("aria-activedescendant", listItem.id);
|
||||
this._selectedGuid = listItem.dataset.guid;
|
||||
|
||||
// Scroll item into view if it isn't visible
|
||||
listItem.scrollIntoView({ block: "nearest" });
|
||||
}
|
||||
}
|
||||
customElements.define("login-list", LoginList);
|
||||
|
|
Загрузка…
Ссылка в новой задаче