Skip to content

Commit

Permalink
update menu and popover
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnMarieW committed Dec 14, 2024
1 parent bceb901 commit fe366f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/ts/components/core/menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ interface Props extends __PopoverProps, StylesApiProps {
setProps: (props: Record<string, any>) => void;
}

/** Menu */
/** Use Menu to combine a list of secondary actions into single interactive area */
const Menu = (props: Props) => {
const { children, setProps, ...others } = props;

return (
<MantineMenu {...others}>
{React.Children.map(children, (child: any, index) => {
const { type: childType, props: childProps } =
child.props._dashprivate_layout;
const {type: childType, props: childProps} =
window.dash_clientside.get_layout(child.props.componentPath);
if (childType === "MenuTarget") {
const { boxWrapperProps } = childProps;
return (
Expand Down
8 changes: 4 additions & 4 deletions src/ts/components/core/popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ const Popover = (props: Props) => {
{...others}
>
{React.Children.map(children, (child: any, index) => {
const childType = child.props._dashprivate_layout.type;
const {type: childType, props: childProps} =
window.dash_clientside.get_layout(child.props.componentPath);

if (childType === "PopoverTarget") {
const { boxWrapperProps } = child.props;
const boxProps = { w: "fit-content", ...boxWrapperProps };
const { boxWrapperProps } = childProps;

return (
<MantinePopover.Target key={index}>
<Box
w="fit-content" {...boxWrapperProps}
onClick={() => setProps({ opened: !opened })}
{...boxProps}
>
{child}
</Box>
Expand Down

0 comments on commit fe366f9

Please sign in to comment.