Skip to content

Commit

Permalink
chore(Modal): fix precision=left|right 时高度丢失
Browse files Browse the repository at this point in the history
  • Loading branch information
cuilanxin committed Oct 25, 2021
1 parent 8651459 commit 61f6879
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/core/src/Modal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import React, { useState, useMemo, useRef } from 'react';
import { Animated, StyleSheet, LayoutChangeEvent, View } from 'react-native';
import { Animated, StyleSheet, LayoutChangeEvent, Dimensions } from 'react-native';
import MaskLayer, { MaskLayerProps } from '../MaskLayer';

let MainWidth = Dimensions.get('window').width;
let MainHeight = Dimensions.get('window').height;

export interface ModalProps extends MaskLayerProps {
placement?: 'top' | 'right' | 'bottom' | 'left';
onClosed?: () => void;
Expand Down Expand Up @@ -116,22 +119,26 @@ const styles = StyleSheet.create({
},
top: {
top: 0,
width: MainWidth,
left: 0,
right: 0,
},
bottom: {
bottom: 0,
left: 0,
width: MainWidth,
right: 0,
},
left: {
bottom: 0,
top: 0,
height: MainHeight,
left: 0,
},
right: {
bottom: 0,
top: 0,
height: MainHeight,
right: 0,
},
});

0 comments on commit 61f6879

Please sign in to comment.