Skip to content

Calendar is cut off when Android screen height is too small #56

Description

@sandeepsengupta

First, thanks for the excellent library! This is the best React Native date picker I have found so far - it is unlike many others in that it provides an up-to-date, native-looking UI right out of the box, with no need to change any Android XML files.

Issue description

On Android, when the screen height is too small (e.g., in landscape mode), the calendar is cut off:

Image

This also happens in split-screen mode - notice the first row of dates is invisible:

Image

Expected behavior

When the window height is small, it would be great if the date picker automatically switched to the more compact "modal date input" mode and hid the calendar icon:

Image

I wonder if this could be achieved using useWindowDimensions().

Steps to reproduce

Create a DatePicker with type="date", run the app in an Android emulator, and switch the emulator to landscape orientation (or enable split-screen mode).

I am using React Native 0.86.0 and @s77rt/react-native-date-picker 3.1.1. The two screenshots in the "Issue description" section above were taken on an Android emulator running Android 16 (API 36.1).

Thanks again for this excellent library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions