Skip to content

Commit

Permalink
fix(mantine): close date range picker on click outside (#3724)
Browse files Browse the repository at this point in the history
* fix(mantine): make sure actions list map have unique keys

* fix(mantine): close date range picker on click outside
  • Loading branch information
gdostie committed May 21, 2024
1 parent cbef2de commit cb7d66b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ export const TableActionsList = (props: TableActionsListProps) => {
</InlineConfirm>
);
}

const prompts = childrenArray.filter((child) => child.type === InlineConfirm.Prompt);
const menuItems = childrenArray
.filter((child) => child.type !== InlineConfirm.Prompt)
.map((child) => {
const {primary, ...childProps} = child.props;
return primary ? <Menu.Item {...childProps} /> : child;
});
const menuItems = Children.map(childrenArray, (child) => {
if (child.type === InlineConfirm.Prompt) {
return null;
}
const {primary, ...childProps} = child.props;
return primary ? <Menu.Item {...childProps} /> : child;
});
return (
<InlineConfirm>
{prompts}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const TableDateRangePicker = factory<TableDateRangePickerFactory>((props,
{...getStyles('dateRangeRoot', {className, style, ...stylesApiProps})}
{...others}
>
<Popover withinPortal opened={opened}>
<Popover withinPortal opened={opened} onChange={setOpened}>
<Popover.Target>
<InputBase
component="button"
Expand Down

0 comments on commit cb7d66b

Please sign in to comment.