Skip to content

Commit

Permalink
Use transitionDuration 0 on both popovers and menus
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Feb 1, 2023
1 parent 3bddafb commit e07c518
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 2 additions & 5 deletions packages/core/ui/DropDownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import ArrowDropDown from '@mui/icons-material/ArrowDropDown'
import Menu, { MenuItem } from './Menu'

const useStyles = makeStyles()(theme => ({
root: {
display: 'flex',
},
buttonRoot: {
'&:hover': {
backgroundColor: alpha(
Expand Down Expand Up @@ -51,7 +48,7 @@ function DropDownMenu({
}

return (
<div className={classes.root}>
<>
<Button
ref={anchorEl}
onClick={handleToggle}
Expand All @@ -70,7 +67,7 @@ function DropDownMenu({
onClose={handleClose}
menuItems={menuItems}
/>
</div>
</>
)
}

Expand Down
1 change: 0 additions & 1 deletion packages/core/ui/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ function Menu(props: MenuProps) {

return (
<Popover
transitionDuration={0}
open={open}
onClose={onClose}
BackdropProps={{ invisible: true }}
Expand Down
10 changes: 10 additions & 0 deletions packages/core/ui/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ export function createJBrowseDefaultProps(/* palette: PaletteOptions = {} */) {
size: 'small' as const,
},
},
MuiPopover: {
defaultProps: {
transitionDuration: 0,
},
},
MuiMenu: {
defaultProps: {
transitionDuration: 0,
},
},
MuiMenuList: {
defaultProps: {
dense: true,
Expand Down

0 comments on commit e07c518

Please sign in to comment.