Skip to content

Commit e2bd58b

Browse files
authored
chore(TextInput): run animations using native driver on iOS (#2550)
1 parent 143037b commit e2bd58b

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

src/components/TextInput/TextInput.tsx

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as React from 'react';
22
import {
33
Animated,
44
TextInput as NativeTextInput,
5-
Platform,
65
LayoutChangeEvent,
76
StyleProp,
87
TextStyle,
@@ -301,11 +300,7 @@ class TextInput extends React.Component<TextInputProps, State> {
301300
Animated.timing(this.state.error, {
302301
toValue: 1,
303302
duration: FOCUS_ANIMATION_DURATION * scale,
304-
// To prevent this - https://github.com/callstack/react-native-paper/issues/941
305-
useNativeDriver: Platform.select({
306-
ios: false,
307-
default: true,
308-
}),
303+
useNativeDriver: true,
309304
}).start();
310305
};
311306

@@ -314,11 +309,7 @@ class TextInput extends React.Component<TextInputProps, State> {
314309
Animated.timing(this.state.error, {
315310
toValue: 0,
316311
duration: BLUR_ANIMATION_DURATION * scale,
317-
// To prevent this - https://github.com/callstack/react-native-paper/issues/941
318-
useNativeDriver: Platform.select({
319-
ios: false,
320-
default: true,
321-
}),
312+
useNativeDriver: true,
322313
}).start();
323314
};
324315

@@ -327,11 +318,7 @@ class TextInput extends React.Component<TextInputProps, State> {
327318
Animated.timing(this.state.labeled, {
328319
toValue: 1,
329320
duration: FOCUS_ANIMATION_DURATION * scale,
330-
// To prevent this - https://github.com/callstack/react-native-paper/issues/941
331-
useNativeDriver: Platform.select({
332-
ios: false,
333-
default: true,
334-
}),
321+
useNativeDriver: true,
335322
}).start();
336323
};
337324

@@ -340,11 +327,7 @@ class TextInput extends React.Component<TextInputProps, State> {
340327
Animated.timing(this.state.labeled, {
341328
toValue: 0,
342329
duration: BLUR_ANIMATION_DURATION * scale,
343-
// To prevent this - https://github.com/callstack/react-native-paper/issues/941
344-
useNativeDriver: Platform.select({
345-
ios: false,
346-
default: true,
347-
}),
330+
useNativeDriver: true,
348331
}).start();
349332
};
350333

0 commit comments

Comments
 (0)