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

Error on component resize when view prop has changed #725

Closed
marwej opened this issue Feb 13, 2018 · 5 comments
Closed

Error on component resize when view prop has changed #725

marwej opened this issue Feb 13, 2018 · 5 comments
Labels

Comments

@marwej
Copy link

marwej commented Feb 13, 2018

Bug

What's the current behavior?

When the view is changed (with new value in prop) the calendar throws an error on component resize.
"Uncaught TypeError: Cannot read property 'scrollHeight' of undefined"
https://github.com/intljusticemission/react-big-calendar/blob/3903fd7066dafcc7dd528fa9889748cf75e0e5df/src/TimeGrid.js#L470

Haven't succeeded with reproducing the problem yet though (I'll keep trying):
https://codesandbox.io/s/wyzj8o3228

What's the expected behavior?

No errors.

@marwej
Copy link
Author

marwej commented Feb 13, 2018

Don't know if abandoning string refs would do anything about this, but perhaps should be done anyway. Will do tests but maybe someone else is faster than me.

@marwej marwej changed the title Error on window resize when view prop has changed Error on component resize when view prop has changed Feb 13, 2018
@mprobus
Copy link

mprobus commented Feb 15, 2018

I've run into same message after navigating from page with a calendar view to one without, and then resizing app. Is this because the TimeGrid resize listener never gets removed?

@panta82
Copy link

panta82 commented Feb 20, 2018

I can confirm the behavior @mprobus has described.

@beausmith
Copy link

I can also confirm this behavior.

image

Repro Steps

  1. View calendar in "month" view.
  2. Resize browser window.
  3. Check console for errors.

@ghost
Copy link

ghost commented Mar 12, 2018

Same here:

image

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

5 participants