-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Clicking backgroundEvent triggers onSelectSlot #2618
Comments
@DianaLaa Have a fix here: #2619 Root of the issue is that, when determining if Although I am not sure if this is actually a bug or working as expected, as it seems that backgroundEvents are meant to be overlayed on top of, which might mean its expected to trigger |
This behavior has been in place since background events were introduces. Because there are people that use this we cannot change it to ignore it. However we did make changes to the onSelectEvent to provide details to differentiate if you need to ignore. As the documentation on that link states
|
@geraldhoxha95 And yes, |
Hello, thank you for your investigation and quick replies. I understand your hesitation in introducing a breaking change. I've digged some deeper into our production code and I have some follow-up questions I hope you're willing to provide a little support with:
Lastly, some curiosity: Could you help me understand with an example what is the use case for triggering both Thanks for your time. Kind regards, |
@DianaLaa I can't give you a lot of details unfortunately, as all of that functionality was written into RBC long ago. I can tell you that, personally, the product I work on uses timers and cancellation (like you see in many of our drag and drop examples in our documentation) to attempt to determine what the user's true intentions are, and only call the event it needs to in the end. My hope is that our next major version (which will be a complete rewrite and major breaking change) will address these sort of issues, but we do not have a solid timeline for that as yet. |
@cutterbl Thank you for your reply and suggestion. I've added a check to our |
Check that this is really a bug
Reproduction link
https://codesandbox.io/p/sandbox/react-big-calendar-example-forked-vpt5d8
Bug description
Reproduction scenario:
onSelectEvent
is calledonSelectSlot
is called, thenonSelectEvent
is calledThis occurs when the calendar has prop
selectable
orselectable='ignoreEvents'
Expected Behavior
When clicking a backgroundEvent, do not trigger
onSelectSlot
.Actual Behavior
When clicking backgroundEvent, first
onSelectSlot
is called, thenonSelectEvent
is calledreact-big-calendar version
1.12.2
React version
18.3.1
Platform/Target and Browser Versions
Chrome latest
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: