trotzig / react-available-times

A calendar to select available time slots
MIT License
98 stars 33 forks source link

document.body.scrollTop deprecated #5

Open yosoyadri opened 6 years ago

yosoyadri commented 6 years ago

I would submit a PR but this is probably a 2 minutes job for you to correct.

In line https://github.com/trotzig/react-available-times/blob/master/src/Day.jsx#L49 to support all browsers and correct/future implementations should be something like:

const realY = pageY - top - (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0);

Reference: http://lists.w3.org/Archives/Public/www-style/2013Oct/0287.html

Great job btw!

trotzig commented 6 years ago

Good catch! Although this would be a quick fix, want to make a PR anyway? The reason I ask is because it would give the project some weight having outside contributors.