hernansartorio / hernansartorio/react-nice-dates

Drag end triggers the onClick handler on mobile

Open
#79 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.1k
Forks
77
PR merge metrics
No merged PRs in 30d

Description

This is because the `handleClick` handler is being passed to the `onTouchEnd` prop in the file below.

https://github.com/hernansartorio/react-nice-dates/blob/21116debff4f50f309d22b1ff75b19c821535c68/src/CalendarDay.js#L54

This is specially an issue when there's not enough vertical space to fit the full height of the calendar on mobile (because of the mobile browser address bar at the top and navigation bar at the bottom, in this case). The user will try to scroll down to click one of the last dates of the month for example triggering the click event will the `CalendarDay` that was initially held for the drag up movement

💡 This is only an issue when `touchDragEnabled` is set to `false`. I could look more into it and submit a PR with a potential fix, if yo want me to.

https://user-images.githubusercontent.com/18352555/129506747-42ef4576-2a3d-45b1-82b9-94def02fb39e.MP4

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.