TextInput editable prop doesn't work
See original GitHub issueCurrent behaviour
I can edit the not editable TextInput
Expected behaviour
I shouldn’t be able to edit the TextInput
Code sample
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { TextInput as TextInputPaper } from 'react-native-paper';
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<TextInputPaper
label='Flat input'
/>
<TextInputPaper
label='Flat input not editable'
editable={false}
/>
<TextInputPaper
label='Outlined input'
mode='outlined'
/>
<TextInputPaper
label='Outlined input not editable'
mode='outlined'
editable={false}
/>
</View>
);
}
}
Screenshots
Your Environment
software | version |
---|---|
ios or android | 12.1 |
react-native | latest |
react-native-paper | latest |
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Making a react-native TextInput readonly - Stack Overflow
I want to make a text input readonly in my RN application. I tried to set an editable prop but it did not...
Read more >TextInput - React Native
TextInput. A foundational component for inputting text into the app via a keyboard. Props provide configurability for several features, ...
Read more >TextInput · React Native Paper
A component to allow users to input text. ... If true, user won't be able to interact with the component. label. Type: TextInputLabelProp....
Read more >A complete guide to TextInput in React Native - LogRocket Blog
Learn how to implement React Native's TextInput component, customize it to collect user inputs, and style your fields with React Native ...
Read more >Accessible React Native TextInput - Hinge Health
How to build an accessible text input in React Native ... When I run this on my iOS device I don't hear the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Using a
TouchableWithoutFeedback
to wrap the non-editableTextInput
works well on iOS, but on Android the text input itself doesn’t fire any events. You have to tap on a very small area of the overall containing view to get the event to fire.In this example, I have a red background to show the area tappable.
Any thoughts @Jack0815 or @satya164 ?
I have the same issue, In my case i remove flex: 1 from style and issue fixed