Closed lazarspasic96 closed 3 years ago
Hi, @lazarspasic96 can you please post those variables because without them I cannot reproduce the same environment of the issue described. Also, what is defined in the ...rest
prop?
`const FormInput = ({ field, label, value, onChange, keyboardType, autoCapitalize, isPassword, customShowPasswordComponent, customHidePasswordComponent, errors, inputRef, ...rest }) => {
const [isFocused, setIsFocused] = useState(false)`
This is what my FormInput component receives as props. The res props is just for sending some additional props to the Floating label"
const [firstName, setFirstName] = useState(name) const [lastName, setLastName] = useState(surname)
This is where I call that component <FormInput label="Ime" errors={errorMessages} field="name" value={firstName} inputRef={firstNameRef} onSubmit={() => firstNameRef.current.focus()} returnKeyType="next" maxLength={50} onChange={setFirstName} containerStyles={formStyles.FormInput} />
The values for name and surname I set in the useEffect
useEffect(() => {
setFirstName(name)
setLastName(surname)
}, [dateOfBirth, userGender, name, surname])
All work perfectly fine in development mode, but when I build app, it does not work very well.
Okay, I'll try to reproduce this issue. Can you inform the used version of this lib?
Current version is 1.3.4
Any update on this? @Cnilton
@lazarspasic96, sorry, not yet, I'll try to give feedback until the end of the week, ok?
@Cnilton Okay, thank you :)
Is there some way to disable the animation when the value is not an empty string?
@lazarspasic96, I'm sorry, but I couldn't reproduce this issue. Code used:
<FloatingLabelInput
label={'label'}
value={val}
onChangeText={(newValue)=> setVal(newValue)}
autoCapitalize={'words'}
isFocused={focused}
onFocus={() => { setFocused(true) }}
onBlur={() => { setFocused(false) }}
blurOnSubmit={false}
/>
and running with npx react-native run-android --variant=release
for disabling animation use staticLabel
prop.
@lazarspasic96 any updates?
@Cnilton I have not fixed it. Still didn't work in a release. You can close the issue, and I will reach out to you if I find out what the issue is.
@lazarspasic96, ok I'll do so. Did you try running with npx react-native run-android --variant=release
?
When I run the application in development mode it works totally fine, but when I build a release app the label not work. It's the same with custom label styles and without. I deliver the default name value to the floating input. It's not an empty string when the component is mounted.