chrisdavies / tiny-date-picker

A small, modern, dependency-free date picker
https://chrisdavies.github.io/tiny-date-picker/
415 stars 87 forks source link

document.documentElement.scrollTop does not work everywhere #54

Closed Droobie closed 6 years ago

Droobie commented 6 years ago

document.documentElement does not work on different browsers like safari on ios. so the dropdown broke for me on those browsers when the user scrolled the page.

i added a check if document.body.scrollTop has an value, if so use document.body else use document.documentElement.

chrisdavies commented 6 years ago

Thanks for the pull request! I dug into the code a bit, and came up an alternative solution that I think is simpler than the original code. Pull the latest (3.1.7) to get the changes.