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

[LOOM-796]: Fix scroll behaviour for _non_ iOS devices #2900

Merged
merged 4 commits into from
Jun 30, 2023
Merged

Conversation

mungodewar
Copy link
Contributor

@mungodewar mungodewar commented Jun 29, 2023

Related to this change. The linked change is bugged in that it removes the lockScroll functionality from non iOS devices/browsers. This is an error and this PR fixes this.

  1. Why wasn't this regression caught in tests?

The tests unfortunetly didn't catch this regression as the mocks used within the unit tests were not being reset correctly. This resulted in a test that was providing false expectations. This has also been addressed within this PR.

  1. Why wasn't this caught in the manual testing done previously in the above PR?

Again unfortunetly only iPhone devices/simulators were tested, the bug only appears on non iOS devices as it was believed that this is the only area of code that was being impacted. 😮‍💨 This changes has been tested against iPHone, iPad and chrome to ensure that all cases are covered, which you will find below.

Screen.Recording.2023-06-29.at.15.39.00.mov
Screen.Recording.2023-06-29.at.15.39.39.mov

iPad util bug discovery

This bug has been detailed and recorded within: KOA-6198

We have identified an issue with the isIpad helper function. This utility does not correctly identify iPads from iOS version 13 and above. This means that without a bug fix to this function the iPad specfic fixes will continue to not be applied to modern versions of iPads.

What is the impact of the iPad util bug?

This means that iPads on iOS >=13 will be able to scroll on content behind all scrims on Skyscanner, the modal must not be "open by default" (see examples below to understand what I mean). That sounds bad, untill you realise that there are very few instances of a non-dismissable modal that is not open by default. In fact, when researching this I couldn't find an example.

In addition to the impact to withScrim users any other components that rely on this behaviour will not function correctly.

Screen.Recording.2023-06-29.at.17.00.11.mov

In the above demo notice how the scroll bug is not present when the modal is initially open, however, when I close and re-open the bug appears.

Some famous modals:

  • Cookie banner -> shown by default & so not impacted
  • Culture selector -> dismissable & so not impacted
  • Login -> dismissable & so not impacted

Regardless, we believe that this should be rectified by Koala but the prio is low.

  • Tests

@mungodewar mungodewar added the patch Patch production bug label Jun 29, 2023
@github-actions
Copy link

Visit https://backpack.github.io/storybook-prs/2900 to see this build running in a browser.

@mungodewar mungodewar changed the title [LOOM-796]: [LOOM-796]: Fix scroll behaviour for _non_ iOS devices Jun 29, 2023
@github-actions
Copy link

Visit https://backpack.github.io/storybook-prs/2900 to see this build running in a browser.

@olliecurtis olliecurtis merged commit b62faed into main Jun 30, 2023
7 checks passed
@olliecurtis olliecurtis deleted the LOOM-796 branch June 30, 2023 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Patch production bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants