-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Constellation:
- Loader at bottom of page
- Loader invisible (display: none)
- Page has a margin-bottom > 0px
Using Chrome, you will be able to scroll to the very bottom of the page including the margin, which will in turn trigger the loader. Checking the console verifies that window.innerHeight === visit.getBoundingClientRect().top.
However, in Safari, the site will not scroll past the bottom margin. Hence, the true bottom of the page will never be reached, and the loader not triggered. Here is an illustration of the issue:
Now, this can be circumvented by either displaying the loader, or by changing the margin on your page so this will never become an issue. However, seeing that window.innerHeight is calculated slightly differently between browsers, there might be a better way.
Ideally, the bottom margin would be accounted for in the checks, even if it is not visible. This does only apply to a narrow set of circumstances though. Alternatively, how about another option that allows us to declare an offset for the loader, which would allow us to trigger it even if it is technically off screen?
