2

Using a fragment of Material UI's sample code for nested icon menus, if I add the "useLayerForClickAway" property and set it to true, when clicking on an item on the second set of menu items, the "parent" popover is not closed as it's supposed to.

<IconMenu
  useLayerForClickAway={true}
  iconButtonElement={<IconButton><MoreVertIcon /></IconButton>}
  anchorOrigin={{horizontal: 'left', vertical: 'top'}}
  targetOrigin={{horizontal: 'left', vertical: 'top'}}
>
  <MenuItem
    primaryText="Copy & Paste"
    rightIcon={<ArrowDropRight />}
    menuItems={[
      <MenuItem primaryText="Cut" />,
      <MenuItem primaryText="Copy" />,
      <Divider />,
      <MenuItem primaryText="Paste" />,
    ]}
  />
</IconMenu>

Is there any way to correct this behavior keeping useLayerForClickAway? Are there any workarounds?

Lorena
  • 135
  • 8

0 Answers0