mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 19:01:52 +08:00
UX: Remove focus on hamburger icon after toggle (#18101)
This commit is contained in:
parent
6294659022
commit
d80535d78f
|
@ -596,9 +596,14 @@ export default createWidget("header", {
|
|||
this.state.hamburgerVisible = !this.state.hamburgerVisible;
|
||||
this.toggleBodyScrolling(this.state.hamburgerVisible);
|
||||
|
||||
// auto focus on first link in dropdown
|
||||
schedule("afterRender", () => {
|
||||
document.querySelector(".hamburger-panel .menu-links a")?.focus();
|
||||
if (this.siteSettings.enable_experimental_sidebar_hamburger) {
|
||||
// Remove focus from hamburger toggle button
|
||||
document.querySelector("#toggle-hamburger-menu").blur();
|
||||
} else {
|
||||
// auto focus on first link in dropdown
|
||||
document.querySelector(".hamburger-panel .menu-links a")?.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user