Closed MarceloPrado closed 3 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
zeego-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Mar 17, 2024 10:25pm |
Nice! Can you ensure support for a Boolean
type for value
as well since this is also supported?
Judging by the Android docs, it seems like there's built-in checkbox support: https://developer.android.com/reference/android/view/MenuItem
I wonder if react-native-menu
supports this, instead of using an icon to show the checked state.
Nice! Can you ensure support for a
Boolean
type forvalue
as well since this is also supported?
I'm using the "normalized" version which should already cover the Boolean
case. Does it make sense?
https://github.com/react-native-menu/menu
It looks like they have a MenuState
at the bottom to leverage the native checkbox capabilities. This should be pretty close to the iOS approach I think...
Ah, got it, I just went off your comment showing the string props. Checking the code, looks like the boolean is indeed supported.
@nandorojo I think this is the closest we get - notice it's setting isVisible
from MenuItem - we'd need to add an additional checked
to MenuAttributes - it's a shame they don't forward the rest of attributes
😔
Closes #45
This PR ensures the CheckboxItem component renders a checkmark on Android when the
<ItemIndicator />
component is available. The implementation follows the composability patterns of Zeego:<ItemIcon />
component.<ItemIndicator />
component. See Notes, I believe this should also be the iOS behavior given what's written in the docs, but this might be a breaking change.<ItemIcon />
is available.Code example
See the Screenshots section for the before/after of running this code:
Screenshots
Notes
My understanding from the ItemIndicator docs is that Android and iOS Menus should only show the native checkmarks if the
<ItemIndicator />
component is rendered. However, this isn't the runtime behavior yet: