Reputation: 261
I want to disable clipboard(copy/paste) in my react-native app
contextMenuHidden={true} didn't work for me.
Upvotes: 1
Views: 3108
Reputation: 261
Attaching below snippet that worked for me
removeClippedSubviews={true} contextMenuHidden={true} onFocus={() => Clipboard.setString('')} onSelectionChange={() => Clipboard.setString('')}
<View removeClippedSubviews={true}>
<TextInput
contextMenuHidden={true}
onFocus={() => Clipboard.setString('')}
onSelectionChange={() => Clipboard.setString('')}
style={styles.searchInput}
onChangeText={this.handleSearch}
value={search} />
</View>
Upvotes: 3
Reputation: 71
Clipboard use mostly in TextInput
fields. you can refer to this post for disabling the clipboard for TextInput
Disable clipboard for TextInput in react native
Upvotes: 1