Skip to content

Commit a91cd78

Browse files
author
shenzhiqing
committed
fix(MenuDropdown): 增加关闭下拉框动画 #376
1 parent 2ffe759 commit a91cd78

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/core/src/MenuDropdown/index.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,14 @@ export default class MenuDropdown extends React.Component<MenuDropdownProps> {
5151
};
5252

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

5964
menuContainer = (event: LayoutChangeEvent) => {

0 commit comments

Comments
 (0)