[LOOM-796]: Fix scroll behaviour for _non_ iOS devices #2900
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.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.
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 identifyiPads
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:
Regardless, we believe that this should be rectified by Koala but the prio is low.