feat(iOS): Don't force "UIScrollViewContentInsetAdjustmentNever" (2.x) #530
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.
Sister PR for 4.x: PR #531
While spending ridiculous amounts of time on PR #!!!, (and all it's related threads), I also looked into the code that is forcing UIScrollViewContentInsetAdjustmentNever mode.
For most users this behavior would be fine, but after reading @dpogue comments here and through this thread I am convinced that forcing this behavior is incorrect. (Especially, when users can control this themselves via html
viewport-fit=cover
.)I have added doc/FAQ.md which describes this in more detail.
The helloWorld Cordova project and the ionic tutorial project uses
viewport-fit=cover
by default. So this should be pretty standard for cordova users.There are 2 pieces of code which force
UIScrollViewContentInsetAdjustmentNever
.1. Originally committed on 2017-09-19 with the message:
Adjust scroll view behavior for iOS 11
[wkWebView.scrollView setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
2. Originally committed on 2017-09-20 with the message:
Code... Swizzling
Honestly not really sure why both of them exist. But, since they are committed within a day of each other, they were both probably just hurrying to fix the temporary ios 11 bug that prevented
viewport-fit=cover
from working (CB-12886).Since it appears the root issue has been solved and released by Apple (at least for iOS 12 and 13 according to my testing), these pieces of code are no longer necessary. (I did not test iOS 11 because I don't have an 11 device, which is because no Apple devices have a max OS of 11, so it should be fairly safe to ignore.)
Environment
I have been testing with:
I have been testing on these devices:
My project is:
I have also tested the 4.x sister PR #531 (which has identical changes basically) with these projects:
modified ionic tutorial
modified cordova helloWorld
Summary
Removing these pieces of code:
Unrelated: It was way too much work to track down all this information. T.T