-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ActionMenu] - fixes after RefreshUI tests #775
Conversation
</button> | ||
</li> | ||
))} | ||
{options.map((o, i) => getOptionElement(o, i))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{options.map((o, i) => getOptionElement(o, i))} | |
{options.map(getOptionElement)} |
const handleItemClick = (itemOnClick: () => void) => { | ||
itemOnClick(); | ||
const handleItemClick = (itemOnClick?: () => void) => { | ||
itemOnClick && itemOnClick(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
itemOnClick && itemOnClick(); | |
itemOnClick?.(); |
|
||
if (!keepOpenOnClick) { | ||
setIsVisible(false); | ||
} | ||
}; | ||
|
||
const getOptionElement = (option: IActionMenuOption, index: number) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to put this element as a separate component into a components
folder
Description
Changed the trigger implementation, it uses the default
button
element, which wraps the element, with the possibility to modify it bytriggerClassName
prop.Also added
groupHeader
prop tooptions
to better group menu elements.Storybook
https://feature/action-menu-trigger-fix--613a8e945a5665003a05113b.chromatic.com/?path=/story/components-actionmenu--keep-open-on-item-click
Checklist
Obligatory:
livechat/design-system
)