mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Revert "prevent auto-scroll when focus is set inside header panels" (#14829)
This reverts commit f444e3e3f7
.
This commit is contained in:
parent
9a72a0945f
commit
641f49748d
@ -484,9 +484,7 @@ export default createWidget("header", {
|
|||||||
|
|
||||||
// auto focus on first button in dropdown
|
// auto focus on first button in dropdown
|
||||||
schedule("afterRender", () =>
|
schedule("afterRender", () =>
|
||||||
document.querySelector(".user-menu button")?.focus({
|
document.querySelector(".user-menu button")?.focus()
|
||||||
preventScroll: true,
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -496,9 +494,7 @@ export default createWidget("header", {
|
|||||||
|
|
||||||
// auto focus on first link in dropdown
|
// auto focus on first link in dropdown
|
||||||
schedule("afterRender", () => {
|
schedule("afterRender", () => {
|
||||||
document.querySelector(".hamburger-panel .menu-links a")?.focus({
|
document.querySelector(".hamburger-panel .menu-links a")?.focus();
|
||||||
preventScroll: true,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -628,9 +624,7 @@ export default createWidget("header", {
|
|||||||
if (this.state.searchVisible) {
|
if (this.state.searchVisible) {
|
||||||
schedule("afterRender", () => {
|
schedule("afterRender", () => {
|
||||||
const searchInput = document.querySelector("#search-term");
|
const searchInput = document.querySelector("#search-term");
|
||||||
searchInput.focus({
|
searchInput.focus();
|
||||||
preventScroll: true,
|
|
||||||
});
|
|
||||||
searchInput.select();
|
searchInput.select();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user