fix(theme): add focused MenuItem background colour

Signed-off-by: logonoff <git@logonoff.co>
This commit is contained in:
logonoff
2025-06-30 20:05:03 -04:00
parent ab539cc72b
commit 373486e449
2 changed files with 15 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/theme': patch
---
Add a different background colour to focused `MenuItem`s to fix a bug in MUI 4 (which is fixed in MUI 5)
@@ -269,4 +269,14 @@ export const defaultComponentThemes: ThemeOptions['components'] = {
MuiPaper: {
styleOverrides: { root: { backgroundImage: 'unset' } },
},
MuiMenuItem: {
styleOverrides: {
root: ({ theme }) => ({
// Fixes a bug with MUI 4 that's fixed in MUI 5
'&:focus': {
backgroundColor: theme.palette.action.focus,
},
}),
},
},
};