feat(core): added code to handle keyboard inputs (#4006)

Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
Priyansh GuptaandAlex Yang authored and GitHub committed 2023-08-31 13:15:55 -05:00
1 parent 6be176b4e3
commit 18d5a99af5
4 files changed
+111 -21

No files matched your search

@@ -15,6 +15,7 @@ export type IconMenuProps = PropsWithChildren<{
disabled?: boolean;
active?: boolean;
disableHover?: boolean;
userFocused?: boolean;
gap?: string;
fontSize?: string;
}> &
+7 -1
View File
@@ -62,11 +62,13 @@ export const StyledMenuItem = styled('button')<{
disabled?: boolean;
active?: boolean;
disableHover?: boolean;
userFocused?: boolean;
}>(({
isDir = false,
disabled = false,
active = false,
disableHover = false,
userFocused = false,
}) => {
return {
width: '100%',
@@ -99,7 +101,11 @@ export const StyledMenuItem = styled('button')<{
: {
backgroundColor: 'var(--affine-hover-color)',
},
...(userFocused && !disabled
? {
backgroundColor: 'var(--affine-hover-color)',
}
: {}),
...(active && !disabled
? {
backgroundColor: 'var(--affine-hover-color)',