Skip to content

Commit 36b6171

Browse files
committed
minor fix
1 parent f2abc30 commit 36b6171

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/components/ButtonWithDropdownMenu/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ import CONST from '@src/CONST';
1717
import type {AnchorPosition} from '@src/styles';
1818
import type {ButtonWithDropdownMenuProps} from './types';
1919

20-
function ButtonWithDropdownMenuInner<IValueType>(props: ButtonWithDropdownMenuProps<IValueType>, ref: React.Ref<{setIsMenuVisible: (visible: boolean) => void}>) {
20+
type ButtonWithDropdownMenuRef = {
21+
setIsMenuVisible: (visible: boolean) => void;
22+
};
23+
24+
function ButtonWithDropdownMenuInner<IValueType>(props: ButtonWithDropdownMenuProps<IValueType>, ref: React.Ref<ButtonWithDropdownMenuRef>) {
2125
const {
2226
success = true,
2327
isSplitButton = true,
@@ -263,5 +267,7 @@ function ButtonWithDropdownMenuInner<IValueType>(props: ButtonWithDropdownMenuPr
263267
}
264268

265269
ButtonWithDropdownMenuInner.displayName = 'ButtonWithDropdownMenu';
266-
const ButtonWithDropdownMenu = forwardRef(ButtonWithDropdownMenuInner);
270+
const ButtonWithDropdownMenu = forwardRef(ButtonWithDropdownMenuInner) as <IValueType>(
271+
props: ButtonWithDropdownMenuProps<IValueType> & {ref?: React.Ref<ButtonWithDropdownMenuRef>},
272+
) => ReturnType<typeof ButtonWithDropdownMenuInner>;
267273
export default ButtonWithDropdownMenu;

src/pages/workspace/WorkspaceOverviewPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ function WorkspaceOverviewPage({policyDraft, policy: policyProp, route}: Workspa
203203
return;
204204
}
205205

206+
dropdownMenuRef.current?.setIsMenuVisible(false);
206207
setIsDeleteModalOpen(true);
207208
}, [setIsDeletingPaidWorkspace]);
208209

0 commit comments

Comments
 (0)