I'm using react-native-popup-menu but I'm trying to increase the area where the user can click for the menu option to be triggered. I've gone through the documentation and there is information about TouchableOpactiy
but it seems to be about styling it but I feel like I'm also not understanding it.
I have a component that I'm passing OptionsMenu
as a prop:
<TouchableOpacity style={{alignContent: 'flex-end', paddingRight:10}} hitSlop={{bottom: 50, top: 50, left: 50, right: 50 }}>
//I know using hitSlop here is wrong and it is not triggering anything here. Just showing what I have.
{OptionMenu}
</TouchableOpacity>
and in another screen I have it set to
<Menu>
<MenuTrigger>
<Svg
viewBox="0 0 64 512"
height={34}
width={10}
fill='#7b8794'
>
<Path d="M32 224c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zM0 136c0 17.7 14.3 32 32 32s32-14.3 32-32-14.3-32-32-32-32 14.3-32 32zm0 240c0 17.7 14.3 32 32 32s32-14.3 32-32-14.3-32-32-32-32 14.3-32 32z" />
</Svg>
</MenuTrigger>
<MenuOptions>
<MenuOption onSelect={() => handleInsert(item, index)} text='Duplicate' />
<MenuOption onSelect={() => handleRemove(index)}>
<Text style={{ color: 'red' }}>Delete</Text>
</MenuOption>
</MenuOptions>
</Menu>
I'm not understanding where I can pass hitSlop
in to be able to increase the touchable
area to trigger the MenuOptions
.