Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React-Native-Popup-Menu with FloatingActionButton Component cannot trigger with MenuTrigger

I would like to use react-native-popup-menu and react-native-floating-action-button components together. I've tried :

<MenuTrigger>
    <FloatingActionButton
        size={56}
        textDisable
        iconName="directions"
        iconType="material-icons"
        shadowColor="#000"
        iconColor="white"
        backgroundColor="#405914"
    />
</MenuTrigger>

This code does not trigger the MenuTrigger because FloatingActionButton's onPress is triggered.


I also tried this kinds of stuff :

<MenuTrigger customStyles={{ TriggerTouchableComponent: FloatingActionButton }} />

This one's trigger is working with MenuTrigger but I cannot customize the FAB button's styling.

Can you provide me a solution ? :)

Thank you

like image 389
FreakyCoder Avatar asked Jul 28 '26 22:07

FreakyCoder


1 Answers

According to doc you could use triggerTouchable.

      <MenuTrigger
        customStyles={{
          TriggerTouchableComponent: Button,
          triggerTouchable: { title: 'Select (Custom Touchables)' },
        }}
      />
like image 131
sodik Avatar answered Jul 31 '26 05:07

sodik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!