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 issue on some devices drawer height was not 100% #104

Merged
merged 1 commit into from
Nov 8, 2022

Conversation

amn-max
Copy link
Contributor

@amn-max amn-max commented Nov 4, 2022

drawer_issue

There were several devices that cause this issue. I have added in the fix as a optional propType fullSize

const screenHeight = window.height
const screenWidth = window.width
const screenHeight = props.fullSize ? Dimensions.get('screen').height : window.height;
const screenWidth = props.fullSize? Dimensions.get('screen').width: window.width;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

} from "react-native"
import PropTypes from "prop-types"

const MenuDrawer = props => {
const fadeAnim = useRef(new Animated.Value(0)).current
const window = useWindowDimensions()
const screenHeight = window.height
const screenWidth = window.width
const screenHeight = props.fullSize ? Dimensions.get('screen').height : window.height;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@amn-max
Copy link
Contributor Author

amn-max commented Nov 7, 2022

After some more investigations, found out that this issue is related to andorid's three button navigation. Some android's have these buttons disabled hence the wrong value in screenHeight. Therefore issue is on react native but not this library. But for people requiring a temporary fix can use the fullSize prop added in this PR and determine if buttons are available by following

facebook/react-native#14887 (comment)

@pedreviljoen pedreviljoen merged commit 1bebfdd into pedreviljoen:master Nov 8, 2022
@pedreviljoen
Copy link
Owner

@amn-max
Thanks for the PR 👏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants