Skip to content

Issue with bottom margin in Safari #1

@mdorr

Description

@mdorr

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:

safari-chrome-scroll-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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions