-
Notifications
You must be signed in to change notification settings - Fork 16
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
Create Menu component #2990
base: develop
Are you sure you want to change the base?
Create Menu component #2990
Conversation
if (graphicsRef.current) { | ||
const interactiveElement = | ||
graphicsRef.current.querySelector<HTMLInputElement>( | ||
'input[type="radio"], input[type="checkbox"], [role="radio"], [role="checkbox"]' | ||
) | ||
|
||
if (interactiveElement) { | ||
interactiveElement.click() | ||
return | ||
} | ||
} |
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.
Can we get same result with using the element? Its default behaviour that it is clicking on input that currently inside the label.
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.
If you mean like that:
const handleClick = () => {
if (graphicsRef.current) {
graphicsRef.current.click()
return
}
onClick?.()
}
: unfortunately, checkbox then is not marked as selected on click.
When I am changing the button tag to label here, I can't get rid of onClick triggering two times, even with event.stopPropagation()
Quality Gate passedIssues Measures |
Add Menu Component
Disabled / Selected / Hovered as in old design
Simple dropdown menu
Menu with checkboxes
Nested dropdowns
Removable items (Absent in design, present in prod notification menu)
Add MenuItem Component
Color variants + align variants
Disabled, Danger color variant