Skip to content

Commit

Permalink
FIX wrapper anchorOrigin error
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarberm committed Dec 17, 2020
1 parent 6c5aa07 commit 2bfafed
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
9 changes: 8 additions & 1 deletion src/ui/stories/widgets/WrapperWidgetUI.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ WithOptions.args = {
title: 'Wrapper with options',
options: [
{ id: 'o1', name: 'Option 1', action: () => alert('Option 1!') },
{ id: 'o2', name: 'Option 2', action: () => alert('Option 2!') },
{ id: 'o2', name: 'Option 2 too long', action: () => alert('Option 2!') },
{ id: 'o3', name: 'Option 2', action: () => alert('Option 2!') },
{ id: 'o4', name: 'Option 2 too long here', action: () => alert('Option 2!') },
{ id: 'o5', name: 'Option 2', action: () => alert('Option 2!') },
{ id: 'o6', name: 'Option 2', action: () => alert('Option 2!') },
{ id: 'o7', name: 'Option 2', action: () => alert('Option 2!') },
{ id: 'o8', name: 'Option 2', action: () => alert('Option 2!') },
{ id: 'o9', name: 'Option 2', action: () => alert('Option 2!') },
],
};

Expand Down
15 changes: 7 additions & 8 deletions src/ui/widgets/WrapperWidgetUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ const useStyles = makeStyles((theme) => ({
height: '56px',
padding: theme.spacing(1.25, 1.25, 1.25, 3),
},
optionsMenu: {
marginTop: theme.spacing(6),
maxHeight: theme.spacing(21),
minWidth: theme.spacing(16),
},
button: {
padding: 0,
cursor: (props) => (props.expandable ? 'pointer' : 'default'),
Expand Down Expand Up @@ -162,7 +167,7 @@ function WrapperWidgetUI(props) {
id='options-menu'
elevation={3}
anchorOrigin={{
vertical: 'bottom',
vertical: 'top',
horizontal: 'right',
}}
transformOrigin={{
Expand All @@ -173,13 +178,7 @@ function WrapperWidgetUI(props) {
keepMounted
open={open}
onClose={handleClose}
PaperProps={{
style: {
marginTop: '48px',
maxHeight: '144px',
width: '128px',
},
}}
PaperProps={{ className: classes.optionsMenu }}
>
{options.map((option) => (
<MenuItem
Expand Down

0 comments on commit 2bfafed

Please sign in to comment.