React-big-calendar: onClick for single date or disable drag to select

Created on 15 Feb 2019  路  3Comments  路  Source: jquense/react-big-calendar

Do you want to request a _feature_ or report a _bug_?

Feature

What's the current behavior?

Unless mistaken, there is no api for when a user clicks on a single date in the calendar. You can set selectable={true} and use onSelectSlot, but this allows the user to select multiple days, and I also don't see a way to limit selection to just one day. Returning false in onSelection only disables drag selection in the Time views (week, day, agenda). Am I missing this feature in the documentation?

wontfix

All 3 comments

It's true, there's no API for this (that I could find, atleast.) One way I got around this is by disregarding the 'end' parameter in onSelectSlot. This simulates a simple click, and allows you to operate on 'selects' as a click, as you don't operate on the 'end' date whatsoever. Unfortunately, this causes some issues when using the calendar on mobile, and I had to further tinker with the eventHandlers in the Selection.js file in an attempt to make touchscreen clicks operate similarly to mouse clicks.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

any update on this? I am looking for this same feature. On mobile, I cannot scroll down without the calendar trying to select a range of dates

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kweisamx picture kweisamx  路  4Comments

dogC76 picture dogC76  路  4Comments

The-Oracle picture The-Oracle  路  3Comments

tiaaaa123 picture tiaaaa123  路  4Comments

ZacharyLangley picture ZacharyLangley  路  3Comments