Duration cannot be less then 10ms (#21858)

Summary:
Related to: #21853

Fixes #21853
Pull Request resolved: https://github.com/facebook/react-native/pull/21858

Differential Revision: D13322060

Pulled By: hramos

fbshipit-source-id: 00a8de018fce6507aa131a11ba3e95d57044e683
This commit is contained in:
Baldy Lukasz 2018-12-04 14:39:56 -08:00 committed by Facebook Github Bot
parent f77aa4eb45
commit 87b6533937

View File

@ -99,9 +99,10 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
if (duration && easing) {
LayoutAnimation.configureNext({
duration: duration,
// We have to pass the duration equal to minimal accepted duration defined here: RCTLayoutAnimation.m
duration: duration > 10 ? duration : 10,
update: {
duration: duration,
duration: duration > 10 ? duration : 10,
type: LayoutAnimation.Types[easing] || 'keyboard',
},
});