Skip to content
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

[Menu] RadioItem component #534

Merged
merged 15 commits into from
Sep 19, 2024
Merged

Conversation

michaldudak
Copy link
Member

@michaldudak michaldudak commented Aug 5, 2024

Created the MenuItemRadioItem and related components.

Closes #53

@michaldudak michaldudak added component: menu This is the name of the generic UI component, not the React module! new feature New feature or request labels Aug 5, 2024
@mui-bot
Copy link

mui-bot commented Aug 5, 2024

Netlify deploy preview

https://deploy-preview-534--base-ui.netlify.app/

Generated by 🚫 dangerJS against 563d2b1

@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Sep 5, 2024
@michaldudak michaldudak marked this pull request as ready for review September 12, 2024 07:36
Comment on lines +22 to +28
const setValue = React.useCallback(
(newValue: any, event: Event) => {
setValueUnwrapped(newValue);
onValueChange?.(newValue, event);
},
[onValueChange, setValueUnwrapped],
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useEventCallback

@colmtuite
Copy link
Contributor

@michaldudak I was surprised that the Menu doesn't close when you select a radio item using Enter. Radix closes the menu whether you select a radio/checkbox item via click, space, or Enter. RA closes on Enter only.

Do you think we should keep the Menu open always? Or close when you select a radio item using Enter?

@michaldudak
Copy link
Member Author

Yeah, it should close after Enter is pressed. I'll fix it.

@michaldudak
Copy link
Member Author

I made the change. I won't update the CheckboxItem, as it's the same code. Once RadioItem gets merged, the CheckboxItem will work automatically.

@michaldudak michaldudak merged commit a88a290 into mui:master Sep 19, 2024
18 checks passed
@michaldudak michaldudak deleted the menu-radioitem branch September 19, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: menu This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Menu] Create the radio menu item
4 participants