Skip to content

Commit

Permalink
fix(taro-rn): 修复 showActionSheet rn android 端与其他端不一致的问题 (#12438)
Browse files Browse the repository at this point in the history
Co-authored-by: tony chen <329604487@qq.com>
  • Loading branch information
shinken008 and zhiqingchen authored Sep 5, 2022
1 parent 887c49a commit ae2d5a8
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions packages/taro-rn/src/lib/showActionSheet/ActionSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
} from 'react-native'
import { ViewPropTypes } from 'deprecated-react-native-prop-types'
import { initialWindowMetrics } from 'react-native-safe-area-context';
import { Mask } from '../Mask'
import { Popup } from '../Popup'
import V from '../variable'

Expand Down Expand Up @@ -59,7 +58,7 @@ const styles = StyleSheet.create({
marginBottom: ((18 * V.baseLineHeight) - 18) / 2
},
androidActionsheetCellText: {
textAlign: 'left',
textAlign: 'center',
fontSize: 16,
marginTop: ((16 * 1.4) - 16) / 2,
marginBottom: ((16 * 1.4) - 16) / 2
Expand Down Expand Up @@ -145,8 +144,7 @@ const Index: React.FC<any> = ({
</TouchableHighlight>
)

return _type === 'ios'
? <Popup
return <Popup
visible={visible}
style={[styles.iosActionsheet, style]}
maskStyle={maskStyle}
Expand All @@ -165,24 +163,6 @@ const Index: React.FC<any> = ({
: false}
<View style={{paddingBottom: Math.max(initialWindowMetrics?.insets.bottom || 0, 16), backgroundColor: '#fff'}}></View>
</Popup>
: <View
style={styles.Modal}
>
<Mask style={[styles.androidActionsheetWrapper, maskStyle]} onPress={onClose}>
<View style={[styles.androidActionsheet, style]}>
{menus.length
? <View style={[styles.actionsheetMenu]}>
{_renderMenuItems()}
</View>
: false}
{actions.length
? <View style={[styles.actionsheetAction]}>
{_renderActions()}
</View>
: false}
</View>
</Mask>
</View>
}

Index.propTypes = {
Expand Down

0 comments on commit ae2d5a8

Please sign in to comment.