Skip to content
Advertisement

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

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

Thanks.

Advertisement

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} />;
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement