From 00109ca4d0ecf738c09f43b67421c82c3da6d0a5 Mon Sep 17 00:00:00 2001 From: groovecoder Date: Mon, 23 Sep 2024 12:13:20 -0500 Subject: [PATCH] fix MPP-3893: remove onAction from menu *item* level Our AliasGenerationButton component passed onAction to both useMenu and useMenuItem hooks. react-aria has deprecated onAction handlers from the menu item level in favor of handling actions at the menu level. Previous versions of react-aria reconciled multiple handlers, but 3.43.3 does not. So our handler was being called twice, causing MPP-3893. (Note: the handler for custom masks was being called twice, but since it did not POST to create an address, it did not create 2 masks.) --- .../src/components/dashboard/aliases/AliasGenerationButton.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/frontend/src/components/dashboard/aliases/AliasGenerationButton.tsx b/frontend/src/components/dashboard/aliases/AliasGenerationButton.tsx index 0d46c9f2d5..5e00afdd7a 100644 --- a/frontend/src/components/dashboard/aliases/AliasGenerationButton.tsx +++ b/frontend/src/components/dashboard/aliases/AliasGenerationButton.tsx @@ -343,7 +343,6 @@ const AliasTypeMenuPopup = (props: AliasTypeMenuPopupProps) => { // TODO: Fix the typing (likely: report to react-aria that the type does not include an isDisabled prop) item={item as unknown as AliasTypeMenuItemProps["item"]} state={popupState} - onAction={props.onAction} onClose={props.onClose} /> ))} @@ -362,7 +361,6 @@ type AliasTypeMenuItemProps = { rendered?: ReactNode; }; state: TreeState; - onAction: AriaMenuItemProps["onAction"]; onClose: AriaMenuItemProps["onClose"]; }; @@ -372,7 +370,6 @@ const AliasTypeMenuItem = (props: AliasTypeMenuItemProps) => { { key: props.item.key, isDisabled: props.item.isDisabled, - onAction: props.onAction, onClose: props.onClose, }, props.state,