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

Improve scroll locking on iOS #2100

Merged
merged 3 commits into from Dec 15, 2022
Merged

Improve scroll locking on iOS #2100

merged 3 commits into from Dec 15, 2022

Commits on Dec 15, 2022

  1. Copy the full SHA
    9d8efb1 View commit details
    Browse the repository at this point in the history
  2. improve scroll locking

    Instead of using the "simple" hack with the `position: fixed;` we now
    went back to the `touchmove` implementation.
    
    The `position: fixed;` causes some annoying issues. For starters, on iOS
    you will now get a strange gap (due to safe areas). Some applications
    also saw "blank" screens based on how the page was implemented.
    
    We also saw some issues internally, where clicking changing the scroll
    position on the main page from within the Dialog.
    
    Think about something along the lines of:
    ```html
    <a href="#interesting-link-on-the-current-page">Interesting link on the page</a>
    ```
    
    This doesn't work becauase the page is now fixed, and there is nothing
    to scroll...
    
    Instead, we now use the `touchmove` again. The problem with this last
    time was that this disabled _all_ touch move events. This is obviously
    not good.
    
    Luckily, we already have a concept of "safe containers". This is what we
    use for the `outside click` behaviour as well. Basically in a Dialog,
    your `Dialog.Panel` is the safe container. But also third party DOM
    elements that are rendered inside that Panel (or as a sibling of the
    Dialog, but not your main app).
    
    We can re-use this knowledge of "safe containers", and only cancel the
    `touchmove` behaviour if this didn't happen in any of the safe
    containers.
    RobinMalfait committed Dec 15, 2022
    Copy the full SHA
    1c88b46 View commit details
    Browse the repository at this point in the history
  3. update changelog

    RobinMalfait committed Dec 15, 2022
    Copy the full SHA
    20f9c50 View commit details
    Browse the repository at this point in the history