Skip to content

Commit

Permalink
fix MPP-3893: remove onAction from menu *item* level
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
groovecoder committed Sep 26, 2024
1 parent 92307a8 commit 00109ca
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
))}
Expand All @@ -362,7 +361,6 @@ type AliasTypeMenuItemProps = {
rendered?: ReactNode;
};
state: TreeState<unknown>;
onAction: AriaMenuItemProps["onAction"];
onClose: AriaMenuItemProps["onClose"];
};

Expand All @@ -372,7 +370,6 @@ const AliasTypeMenuItem = (props: AliasTypeMenuItemProps) => {
{
key: props.item.key,
isDisabled: props.item.isDisabled,
onAction: props.onAction,
onClose: props.onClose,
},
props.state,
Expand Down

0 comments on commit 00109ca

Please sign in to comment.