Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions components/ModalDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import React, {

import {
StyleSheet,
Dimensions,
View,
Text,
TouchableWithoutFeedback,
Expand All @@ -23,6 +22,7 @@ import {

import ListView from "deprecated-react-native-listview";
import PropTypes from 'prop-types';
import { initialWindowMetrics } from 'react-native-safe-area-context';

const TOUCHABLE_ELEMENTS = [
'TouchableHighlight',
Expand Down Expand Up @@ -227,9 +227,9 @@ export default class ModalDropdown extends Component {
_calcPosition() {
const {dropdownStyle, style, adjustFrame} = this.props;

const dimensions = Dimensions.get('window');
const windowWidth = dimensions.width;
const windowHeight = dimensions.height;
const {width, height} = initialWindowMetrics.frame;
const windowWidth = width;
const windowHeight = height;

const dropdownHeight = (dropdownStyle && StyleSheet.flatten(dropdownStyle).height) ||
StyleSheet.flatten(styles.dropdown).height;
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
"url": "https://github.com/sohobloo/react-native-modal-dropdown.git"
},
"dependencies": {
"deprecated-react-native-listview": "0.0.5",
"prop-types": "^15.6.0",
"deprecated-react-native-listview": "0.0.5"
"react-native-safe-area-context": "^4.3.1"
},
"scripts": {
"test": "echo \"no test specified\" && exit 0"
Expand Down