I'm currently working with react-native-paper and I'm trying to replicate the focused style of the TextInput component. By default, the TextInput component displays the label text instead of the placeholder when is not focused. Instead, I'd like to have the focused style, when the label is moved to the top and the placeholder is in the value position (see images below).
Is there a way to achieve this using the react-native-paper library without altering the default behavior too much? I don't know if there's a property like "focused" or something like that.
Any guidance or examples on how to achieve this customization would be greatly appreciated. Thank you!
PD: I'm not trying to actually focus the input, I just want the style.
focused (I want the text input to always be like this, even when is not focused)
here's my code:
<TextInput
placeholder="Enter Your First Name"
label="First Name"
value={firstName}
onChangeText={(text) => setFirstName(text)}
style={styles.input}
left={<TextInput.Icon icon="account-outline" />}
/>

This can't be achieve by using props, you have to make some changes into the library's core code.
Directory:
Read and understand the blow code,
if (value || focused)is responsible for changing position ofLabel& showingPlaceholderJust change
value || focusedto1, which will remove the condition.For
precisionhere is the exact location where i changed.Library Version:
"react-native-paper": "^5.10.3"