-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
MenuItem
: Refactor to TypeScript
#53132
MenuItem
: Refactor to TypeScript
#53132
Conversation
MenuItem
: Refactor to TypeScript
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.
Great work here, thank you! 🎉
I noticed a couple small things, but this is very close to landing. Aside from that, we'll also need a changelog entry, and we'll need to resolve the merge conflict (looks like a disabled
prop was added recently in #52737).
packages/components/src/tools-panel/tools-panel-header/component.tsx
Outdated
Show resolved
Hide resolved
- Convert menu-item.js to tsx - Update JSDoc
0eb4f0c
to
87b0620
Compare
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.
Awesome work here, thank you!
I really enjoyed collaborating with you on these. Looking forward to see you around more 🙌
Thank you for taking the time to review these commits, I actually created some other PRs while waiting for the updates Next step would be provide the missing stories for the MenuItem component, FYI I updated the list of missing stories? Though I think it would be wiser to wait for the update on your notes #36128 (comment) |
Hi @bangank36! We use
Are these supposed to be accepted? |
@noahtallen We basically omitted a bunch of Button props we thought were inappropriate in a MenuItem context. Can you point to some use cases for |
Yeah, given that the styles are also heavily overridden in that case, it's not a prop that MenuItem will want to officially allow, at least in its current form. If there's a need for a specific state/style variant, we can add that to MenuItem in a way that's appropriately styled and named. Otherwise, I think for now you should |
We'd have to look into it, but off the top of my head, no. Because I don't think the ARIA Menu pattern has a semantic "selected" state. You'd either use a (Also FYI a DropdownMenu v2 is in the works) |
Got it -- I did add a couple of one-off wrapper types inline, but I can remove those. Should I just delete the variant/isPressed props if they don't actually do anything? |
They will do something, because those props are still passed through to the underlying Button. It's just that we "discouraged" it at the TypeScript level. |
Good to know! Thanks for the clarification. |
What?
Refactor MenuItem component to TypeScript
Why?
Part of #35744, as suggested in #36128 (comment)
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast