Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Options on React-Native Text Input

I am using TextInput for a project and wanted to DISABLE any kind of text selection or actions like (cut/copy/paste/share) as shared in the screenshot below.

I am not able find anything in the react-native official documentation

enter image description here

like image 282
firebolt_ash Avatar asked Mar 19 '17 07:03

firebolt_ash


People also ask

How do I turn off textfield in react?

Disable the TextBox by adding the e-disabled to the input parent element and set disabled attribute to the input element.

How do I disable input field based on condition in react?

To disable an input field inside a <Form /> function component, we will use isDisabled local state and it's setter method setIsDisabled , defined using the useState() hook.

How do I turn off autofill in React Native?

How to disable autocomplete on react native paper TextInput? with autoComplete="off" render autocomplete="noop" on the web. Bookmark this question. Show activity on this post. The autoComplete="off" is replaced with autocomplete="noop" in the rendered HTML, which cause the auto complete not to be disabled.


1 Answers

You should add 2 attributes selectTextOnFocus and editable

For example:

<TextInput editable={false} selectTextOnFocus={false} /> 
like image 107
Artem Tutov Avatar answered Sep 23 '22 06:09

Artem Tutov