Closed rechtar closed 1 year ago
Hi there! First of all, bravo for the library 😁 Definitely the best of the kind I've found so far both in terms of appearance and API design.
There's a small bug in v0.5.0: in the code to open a menu:
modal.show( 'menu', { items: [ { text: 'Default variant', onPress: () => {} }, { text: 'Cancel variant', variant: 'cancel', onPress: () => {} }, { text: 'Destructive variant', variant: 'destructive', onPress: () => {} }, ], }, );
None of these onPress callbacks get called. I looked into the source code and was able to fix it by changing a line in Menu.tsx:
onPress
Menu.tsx
<MenuItem key={item.text} onPress={createActionCallback()} theme={theme} variant={item.variant}>
to
<MenuItem key={item.text} onPress={createActionCallback(item.onPress)} theme={theme} variant={item.variant}>
Just posting it here so you guys can fix it upstream. Thanks for the work! 👍
Hi! I am happy to hear that :)
Thank you! Issue is fixed. Please update to 0.5.1
https://github.com/inferusvv/react-native-unicorn-modals/pull/6
Hi there! First of all, bravo for the library 😁 Definitely the best of the kind I've found so far both in terms of appearance and API design.
There's a small bug in v0.5.0: in the code to open a menu:
None of these
onPress
callbacks get called. I looked into the source code and was able to fix it by changing a line inMenu.tsx
:to
Just posting it here so you guys can fix it upstream. Thanks for the work! 👍