-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Multiple events completely hidden by another event in Day/Week views #1086
Comments
Hi @drewtonynguyen, with your example, you are correct that a and b's times should be compared in both directions. However it has some unfortunate side-effects, like the perfectly correct : becoming and becoming From what I see, the problem stems from doing the computation of rows in the order given by sortByRender and not just in the order ('startMs', '-endMS'). @jquense : why the complex logic in https://github.com/intljusticemission/react-big-calendar/blob/master/src/utils/DayEventLayout.js#L105 given that the rows computation only require the first line? Is it to alternate the rendering between non-overlapping events of the same row like in the following screenshot in order to increase readability? I don't see another use case and it creates the problems told above, where we have to choose between two incorrect renderings (@drewtonynguyen's being less incorrect). |
I am also running into the hiding of events issue and this proposed fix seems to work and make sense. |
Thanks @bgelineau. I tested changing the sortByRender method as so, removing the logic you mentioned: function sortByRender(events) {
const sortedByTime = sortBy(events, ['startMs', e => -e.endMs])
return sortedByTime
} and my example now looks like: |
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. |
@drewtonynguyen It looks much nicer with your solution. @bgelineau Is there any chance, we can make this an option, so people can actually choose their sorting behavior? I will allow uglier representation, over some hidden events. Thanks, |
Do you want to request a feature or report a bug?
Bug.
What's the current behavior?
Using Big Calendar v0.20.1. step is 30, timeslots is 2.
Events are:
I've been able to reproduce a rare case in which multiple overlapping events are hidden by a larger event.
As you can see, Events I and J are completely hidden by Event H.
I suspect it has something to do with the onSameRow function in
DayEventLayout.js
:I see that in #910, there was a reversal in the direction of the comparison between a and b's start and end slots. However, if I add the original check back in and check both directions:
I end up with the following layout of events:
As you can see, all events are now visible. Any thoughts, @bgelineau? Would checking a and b's time slots in both directions for the same row computation be the right fix here? I can make a PR to add the check back in if so.
What's the expected behavior?
All events should be shown.
The text was updated successfully, but these errors were encountered: