Skip to content

Commit ca910ea

Browse files
committed
fix(ActionSheet): 修复关闭后无法再次弹出
1 parent 4be015b commit ca910ea

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/core/src/ActionSheet/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ export default function ActionSheet(props: ActionSheetProps) {
8282
}
8383
};
8484

85-
const onClose = () => {
86-
setState({ stateVisible: false, control: 'state' });
87-
};
85+
const onClose = () => onCancel?.();
8886

8987
return (
9088
<Modal
@@ -95,7 +93,7 @@ export default function ActionSheet(props: ActionSheetProps) {
9593
visible={state.stateVisible}
9694
onClosed={onModalClose}
9795
>
98-
<>
96+
<View>
9997
{React.Children.toArray(children).map((item, index) => (
10098
<View key={index}>
10199
{index !== 0 && <View style={StyleSheet.flatten([styles.itemDivider, dividerStyle?.itemDivider])} />}
@@ -114,7 +112,7 @@ export default function ActionSheet(props: ActionSheetProps) {
114112
containerStyle={containerStyle}
115113
textStyle={textStyle}
116114
/>
117-
</>
115+
</View>
118116
</Modal>
119117
);
120118
}

0 commit comments

Comments
 (0)