This repository was archived by the owner on Mar 19, 2025. It is now read-only.
This repository was archived by the owner on Mar 19, 2025. It is now read-only.
Bug - TextInputMask is not a controlled component #297
Open
Description
Hello,
I was trying to use TextInputMask in my project but I saw that this component is not a controlled component. When I set a fixed value, I expect that input to not to change no matter what. But as I see, TextInputMask behaves different than TextInput. Is that a bug or is that the behaviour? When I check the react-native documents for TextInput there is a section it says
The value to show for the text input. TextInput is a controlled component
Here is a sample code and video recording from a recently created project
Version
"dependencies": {
"react": "18.2.0",
"react-native": "0.71.10",
"react-native-text-input-mask": "^3.1.4"
},
Code
import React from "react";
import { SafeAreaView, ScrollView, Text, TextInput } from "react-native";
import TextInputMask from "react-native-text-input-mask";
function App() {
return (
<SafeAreaView>
<ScrollView contentInsetAdjustmentBehavior="automatic">
<Text>TextInput</Text>
<TextInput value="1234" />
<Text style={{ marginTop: 24 }}>TextInputMask</Text>
<TextInputMask value="1234" />
</ScrollView>
</SafeAreaView>
);
}
export default App;
Video recording
Screen.Recording.2023-06-14.at.17.04.19.mov
Thank you.
Metadata
Metadata
Assignees
Labels
No labels