Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dropdown items not display issue when dropdown render at bottom in android #270

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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