fix: keep CHRNX header focus visible
This commit is contained in:
2 files changed
+102
No files matched your search
@@ -182,10 +182,19 @@
|
||||
setActivePanel( null );
|
||||
}
|
||||
};
|
||||
const focusSafely = ( element ) => {
|
||||
try {
|
||||
element.focus( { preventScroll: true } );
|
||||
} catch {
|
||||
element.focus();
|
||||
}
|
||||
};
|
||||
const onMenuClick = () => {
|
||||
focusSafely( menuButton );
|
||||
setActivePanel( activePanel === PANEL.menu ? null : PANEL.menu );
|
||||
};
|
||||
const onThemeClick = () => {
|
||||
focusSafely( themeButton );
|
||||
setActivePanel( activePanel === PANEL.theme ? null : PANEL.theme );
|
||||
};
|
||||
const onSearchSubmit = ( event ) => {
|
||||
|
||||
Reference in new issue
Block a user