Is there a way to enable selection when TextInput is set to editable=false

Tags: , ,



I’m wondering if any of you know of a way to make TextInput selectable while the editable={false}.

Thanks.

Answer

This is the current behavior of React Native
you can fake TextInput in your case with Text and use selectable props https://reactnative.dev/docs/text#selectable

or something like this

this.state.editable ? <TextInput /> : <Text selectable={true} />;


Source: stackoverflow