Open abaksha-sc opened 11 months ago
For those who will find this issue I'll leave a fast and dirty workaround: https://codesandbox.io/s/react-big-calendar-example-forked-z8459t?file=/src/App.js
The idea is to detect if node .rbc-slot-selection
was rendered:
onSelectSlot={(data) => {
// when node 'rbc-slot-selection' exist that means the slot was selected, but not clicked
const fixedAction =
data.action === "click" &&
document.querySelector(".rbc-slot-selection")
? "select"
: data.action;
// now use variable "fixedAction" instead of provided
UPD: but sometimes node .rbc-slot-selection
disappears earlier than handler onSelectSlot
calls :(
So this workaround is not stable
Check that this is really a bug
Reproduction link
https://codesandbox.io/s/react-big-calendar-example-forked-fv8lkc?file=/src/App.js
Bug description
When slot is selected with a few pixels mouse movement then
onSelectSlot
providesaction
asclick
, but notselect
. Even when slot is really was selected:Steps to repeat:
Expected Behavior
It should has action
select
.Actual Behavior
It provides action
click
when slot was selected.For example I ignore all
click
events and allow to add events with slot selection only. And because of this bug user disallows to add event with such small range.react-big-calendar version
1.8.1
React version
18.2.0
Platform/Target and Browser Versions
Chrome
Validations
Would you like to open a PR for this bug?