Currently, I am utilizing MUI's Menu / MenuItem to create a menu of missions / tasks similar to the screenshot below:
https://i.sstatic.net/6FGrx.png
The MenuItem
is interactive:
// ... other code
<MenuItem
value={mission.issueIdentifierId}
sx={{px: 0.5}}
onClick={() => handleMenuItemClick(mission.issueIdentifierId)}
>
<UploadMissionCard mission={mission} />
</MenuItem>
// ... other code
Upon clicking it, a modal window will appear displaying detailed information.
Within the MenuItem
, there exists the UploadMissionCard
component which, in certain scenarios, features an MUI Button named Abort
. Upon clicking this button, another warning modal window should be displayed.
However, what currently occurs is that when I click the button, the click action also applies to the menuItem
, causing both modal windows to open simultaneously.
My question is, how can I include a Button
within a MenuItem
in MUI and prevent the click action on the button from affecting the parent MenuItem
?