This is an automated email from the ASF dual-hosted git repository. GitToTheHub pushed a commit to branch pr-doc-scrollViewDidChangeAdjustedContentInset in repository https://gitbox.apache.org/repos/asf/cordova-ios.git
commit 868f14bac6508cf95d67cf47fb8a80a42a126335 Author: Manuel Beck <[email protected]> AuthorDate: Wed Aug 26 10:23:42 2026 +0200 doc(CDVViewController): document `scrollViewDidChangeAdjustedContentInset:` - Make clear that this is called when the ?`WKWebView` is initialized and also when `viewport-fit` is changed. --- CordovaLib/Classes/Public/CDVViewController.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CordovaLib/Classes/Public/CDVViewController.m b/CordovaLib/Classes/Public/CDVViewController.m index 3c24d7b0..fd595a8a 100644 --- a/CordovaLib/Classes/Public/CDVViewController.m +++ b/CordovaLib/Classes/Public/CDVViewController.m @@ -578,6 +578,11 @@ static UIColor *defaultBackgroundColor(void) { } } +/** + * This is called initially when the WKWebView is initialized and also when viewport-fit is changed. + * WebKit still doesn't expose _webView:didChangeSafeAreaShouldAffectObscuredInsets: as public API, + * so we need to react based on the scrollView delegate. + */ - (void)scrollViewDidChangeAdjustedContentInset:(UIScrollView *)scrollView { #if !defined(TARGET_OS_VISION) || !TARGET_OS_VISION @@ -586,6 +591,9 @@ static UIColor *defaultBackgroundColor(void) { return; } + // Detect changes on viewport-fit: + // viewport-fit=cover causes the contentInsetAdjustmentBehavior to be UIScrollViewContentInsetAdjustmentNever + // // On Mac Catalyst, Cordova may manually constrain the web view below the title bar. // In that case automatic scroll-view inset adjustment is disabled, so the synthetic // status bar view should be hidden. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
