Closed eridanurce closed 5 days ago
@eridanurce the reason this is happening is because two events happen in sequence when you click the custom anchor:
By default, clicking outside a menu closes it unless you click the built-in MenuTrigger
. Without that, the Menu component has no way to know that the custom trigger is a trigger, and not just another outside-menu element. You can re-add that check yourself within the onOpenChange
callback to prevent it from treating the custom trigger as an outside-menu click, which I've added to this sandbox: https://codesandbox.io/p/sandbox/festive-khayyam-kf6q39?file=%2Fsrc%2Fexample.tsx%3A29%2C24
Let me know if that makes sense and solves your use case!
This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your contributions to Fluent UI!
Library
React Components / v9 (@fluentui/react-components)
System Info
Are you reporting Accessibility issue?
no
Reproduction
https://codesandbox.io/p/sandbox/eloquent-jennings-t6qw2m?file=%2Fsrc%2Fexample.tsx%3A22%2C5
Bug Description
Actual Behavior
Expected Behavior
The menu popover should close on step 2, like it does for all other menus. https://react.fluentui.dev/?path=/docs/components-menu-menu--default
Logs
No response
Requested priority
Normal
Products/sites affected
Dynamics 365 Business Central
Are you willing to submit a PR to fix?
no
Validations