prevent auto-scroll when focus is set inside header panels
This commit is contained in:
parent
8586088b87
commit
f444e3e3f7
|
@ -484,7 +484,9 @@ export default createWidget("header", {
|
|||
|
||||
// auto focus on first button in dropdown
|
||||
schedule("afterRender", () =>
|
||||
document.querySelector(".user-menu button")?.focus()
|
||||
document.querySelector(".user-menu button")?.focus({
|
||||
preventScroll: true,
|
||||
})
|
||||
);
|
||||
},
|
||||
|
||||
|
@ -494,7 +496,9 @@ export default createWidget("header", {
|
|||
|
||||
// auto focus on first link in dropdown
|
||||
schedule("afterRender", () => {
|
||||
document.querySelector(".hamburger-panel .menu-links a")?.focus();
|
||||
document.querySelector(".hamburger-panel .menu-links a")?.focus({
|
||||
preventScroll: true,
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -624,7 +628,9 @@ export default createWidget("header", {
|
|||
if (this.state.searchVisible) {
|
||||
schedule("afterRender", () => {
|
||||
const searchInput = document.querySelector("#search-term");
|
||||
searchInput.focus();
|
||||
searchInput.focus({
|
||||
preventScroll: true,
|
||||
});
|
||||
searchInput.select();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue