From e2db6a994dde0d7accbee907058559caaee6ccc8 Mon Sep 17 00:00:00 2001 From: Lucas Bordeau Date: Thu, 8 Feb 2024 14:12:23 +0100 Subject: [PATCH] Fixed drawer not closing on task creation on Show Page (#3867) Fixed close dropdown --- .../ui/layout/show-page/components/ShowPageAddButton.tsx | 7 +++++-- .../show-page/constants/ShowPageAddButtonDropdownId.ts | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 packages/twenty-front/src/modules/ui/layout/show-page/constants/ShowPageAddButtonDropdownId.ts diff --git a/packages/twenty-front/src/modules/ui/layout/show-page/components/ShowPageAddButton.tsx b/packages/twenty-front/src/modules/ui/layout/show-page/components/ShowPageAddButton.tsx index 3355f6f0f..b0b3daa7e 100644 --- a/packages/twenty-front/src/modules/ui/layout/show-page/components/ShowPageAddButton.tsx +++ b/packages/twenty-front/src/modules/ui/layout/show-page/components/ShowPageAddButton.tsx @@ -8,6 +8,7 @@ import { IconCheckbox, IconNotes, IconPlus } from '@/ui/display/icon/index'; import { IconButton } from '@/ui/input/button/components/IconButton'; import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer'; import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown'; +import { SHOW_PAGE_ADD_BUTTON_DROPDOWN_ID } from '@/ui/layout/show-page/constants/ShowPageAddButtonDropdownId'; import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem'; import { Dropdown } from '../../dropdown/components/Dropdown'; @@ -22,7 +23,9 @@ export const ShowPageAddButton = ({ }: { entity: ActivityTargetableObject; }) => { - const { closeDropdown, toggleDropdown } = useDropdown('add-show-page'); + const { closeDropdown, toggleDropdown } = useDropdown( + SHOW_PAGE_ADD_BUTTON_DROPDOWN_ID, + ); const openCreateActivity = useOpenCreateActivityDrawer(); const handleSelect = (type: ActivityType) => { @@ -33,7 +36,7 @@ export const ShowPageAddButton = ({ return (