Skip to content
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

Wrong time indicator position when changing min prop #2654

Open
4 of 5 tasks
orck-adrouin opened this issue Sep 19, 2024 · 0 comments
Open
4 of 5 tasks

Wrong time indicator position when changing min prop #2654

orck-adrouin opened this issue Sep 19, 2024 · 0 comments
Labels

Comments

@orck-adrouin
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/react-big-calendar-example-forked-5vg8lz

Bug description

The time indicator position is not recalculated when changing the min prop value.

Our app display a blank calendar (no min/max values) while it is fetching the events from the server. Upon receiving the events it calculates the min/max values to use based on the events and update the calendar's props. I added a "clicky" button in the repro to simulate how our app changes the min value.

You can see the behavior the following GIF. You will also notice that selecting an event changes the position of the time indicator.

big-calendar-time-position

I developed the repro using Firefox however while posting this issue I noticed another, probably related, bug when using Chrome: changing the min/max values causes the header to be misaligned because the scrollbar is no longer visible. Do you want me to open another issue about this Chrome issue? GIF:

big-calendar-header-chrome

Expected Behavior

I expect the time indicator to be correctly positioned.

Actual Behavior

The "top offset" of the time indicator is not updated then the min prop changes and because of that it is not at the correct position. Forcing the calendar to render either by selecting an event or resizing the windows "fixes" the issue.

react-big-calendar version

1.14.1

React version

17.0.2

Platform/Target and Browser Versions

Windows Chrome, Firefox

Validations

  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a react-big-calendar issue and not an implementation issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant