Skip to content

Commit

Permalink
Merge pull request #392 from didiboji/szq
Browse files Browse the repository at this point in the history
fix(MenuDropdown): 增加关闭下拉框动画 #376
  • Loading branch information
ChenlingasMx authored Sep 16, 2022
2 parents bb86e1f + be56672 commit 3249824
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/core/src/MenuDropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,14 @@ export default class MenuDropdown extends React.Component<MenuDropdownProps> {
};

animateClose = () => {
this.setState({
listHeightValue: new Animated.Value(0),
});
// this.setState({
// listHeightValue: new Animated.Value(0),
// });
Animated.timing(this.state.listHeightValue, {
toValue: 0,
duration: 400,
useNativeDriver: false, // 动画值在不同的驱动方式之间是不能兼容的。因此如果你在某个动画中启用了原生驱动,那么所有和此动画依赖相同动画值的其他动画也必须启用原生驱动。
}).start();
};

menuContainer = (event: LayoutChangeEvent) => {
Expand Down

0 comments on commit 3249824

Please sign in to comment.