Skip to content

Commit e3a8ee0

Browse files
authored
Merge pull request #207 from DogusErdem/fix/text-input-focus-bug-fix
fix: Text input focus bug fix
2 parents d934814 + c7e7de9 commit e3a8ee0

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/components/TextInput/TextInput.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,17 @@ const TextInput: FCCWD<TextInputProps & RNTextInputProps> = (
198198
setIsFocused(false);
199199
};
200200

201+
useEffect(() => {
202+
if (!props?.value && !isFocused) {
203+
textInputOffset.value = withTiming(1);
204+
setIsFocused(false);
205+
setCounts(0);
206+
} else {
207+
textInputOffset.value = withTiming(0);
208+
setIsFocused(true);
209+
}
210+
}, [props?.value]);
211+
201212
return (
202213
<View style={[containerStyle]}>
203214
<Animated.View style={[{

0 commit comments

Comments
 (0)