1

Is there any way to disable clipboard for Textinput so that user can not copy or paste text. Or any way to detect copy/paste clipboard event in react native. Note : caretHidden=true and contextMenuHidden=true are not working fine.

Arain001
  • 109
  • 1
  • 2
  • 10

1 Answers1

1

Try clearing the clipboard inside that view. Add this inside render()

Clipboard.setString('');

Edit

<TextInput onFocus={() => Clipboard.setString('')} onSelectionChange={() => Clipboard.setString('')}/>

Harikrishnan
  • 9,688
  • 11
  • 84
  • 127
  • how to stop user from coping text after render() is called ? – Arain001 Feb 12 '19 at 09:50
  • It is working fine But i want to disable clipboard because i do not want the user to copy the sensitive value from clipboard.In current scenario we are clearing the copied clipboard. Applications like "Clipboard Manager" easily log the the value whenever user copy text from clipboard although we have cleared the clipboard.Is there any way the copy/paste does not appear on long press or double press – Arain001 Feb 12 '19 at 10:43
  • Even if we disable copy (clipboard), user still can grab the sensitive info displayed on screen just by taking screenshot. – Harikrishnan Feb 12 '19 at 11:19
  • U r right but its a requirement to disable clipboard – Arain001 Feb 12 '19 at 11:21