Skip to content

Commit a33d999

Browse files
RichardLindhoutsatya164
authored andcommitted
fix: fix initial label position when value is set on RN 0.61 (#1441)
1 parent 2f25bfa commit a33d999

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/TextInput/TextInput.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,10 @@ class TextInput extends React.Component<TextInputProps, State> {
210210
componentDidUpdate(prevProps: TextInputProps, prevState: State) {
211211
if (
212212
prevState.focused !== this.state.focused ||
213-
prevState.value !== this.state.value
213+
prevState.value !== this.state.value ||
214+
// workaround for animated regression for react native > 0.61
215+
// https://github.com/callstack/react-native-paper/pull/1440
216+
prevState.labelLayout !== this.state.labelLayout
214217
) {
215218
// The label should be minimized if the text input is focused, or has text
216219
// In minimized mode, the label moves up and becomes small

0 commit comments

Comments
 (0)