EN VI

React-native - Disable native context menu in react native gifted chat?

2024-03-14 03:30:07
How to React-native - Disable native context menu in react native gifted chat

In my react-native-gifted-chat application I want to use my custom context menu when long pressing message bubble. So I use react-native-context-menu-view like below.

const ChatContextMenu = ({bubbleProps}: Props) => {
    
    return (
        <ContextMenu
            actions={[{title: 'Delete'}]}
            onPress={(event) => {
                if (event.nativeEvent.name === 'Delete') {
                    console.log('deleting...')
                }
            }}
        >
            <Bubble
                {...bubbleProps}
            />
        </ContextMenu>
    )
}

And it works but when I long press the bubble, also the native context menu appears like in the photo below

enter image description here

How can I disable this?

Solution:

<GiftedChat
  onLongPress={()=> {}}
Answer

Login


Forgot Your Password?

Create Account


Lost your password? Please enter your email address. You will receive a link to create a new password.

Reset Password

Back to login