Revert "prevent auto-scroll when focus is set inside header panels" (#14829)

This reverts commit f444e3e3f7.
This commit is contained in:
Joe 2021-11-08 09:11:26 +08:00 committed by GitHub
parent 9a72a0945f
commit 641f49748d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -484,9 +484,7 @@ export default createWidget("header", {
// auto focus on first button in dropdown
schedule("afterRender", () =>
document.querySelector(".user-menu button")?.focus({
preventScroll: true,
})
document.querySelector(".user-menu button")?.focus()
);
},
@ -496,9 +494,7 @@ export default createWidget("header", {
// auto focus on first link in dropdown
schedule("afterRender", () => {
document.querySelector(".hamburger-panel .menu-links a")?.focus({
preventScroll: true,
});
document.querySelector(".hamburger-panel .menu-links a")?.focus();
});
},
@ -628,9 +624,7 @@ export default createWidget("header", {
if (this.state.searchVisible) {
schedule("afterRender", () => {
const searchInput = document.querySelector("#search-term");
searchInput.focus({
preventScroll: true,
});
searchInput.focus();
searchInput.select();
});
}