Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Conversation

@bparrishMines
Copy link
Contributor

@bparrishMines bparrishMines commented Jul 14, 2022

It looks like these lines were missed when creating the new implementation:

if (@available(iOS 11.0, *)) {
_webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
if (@available(iOS 13.0, *)) {
_webView.scrollView.automaticallyAdjustsScrollIndicatorInsets = NO;
}
}

This PR adds them to FWFWebView and adds the tests from the old implementation to verify these settings.

Fixes: flutter/flutter#107639

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@bparrishMines bparrishMines requested a review from cyanglaz as a code owner July 14, 2022 16:21
@github-actions github-actions bot added p: webview_flutter Edits files for a webview_flutter plugin platform-ios labels Jul 14, 2022
Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +433 to +442
FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init];
FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc]
initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger))
instanceManager:instanceManager];

[instanceManager addDartCreatedInstance:[[WKWebViewConfiguration alloc] init] withIdentifier:0];

FlutterError *error;
[hostAPI createWithIdentifier:@1 configurationIdentifier:@0 error:&error];
FWFWebView *webView = (FWFWebView *)[instanceManager instanceForIdentifier:1];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits: Should all of these wrapped inside if (@available(iOS 13, *)) so they don't run if below iOS 13?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I updated the methods with their repspective API_AVAILABLE(ios(11.0))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I'll use that next time. I didn't know there were XCT methods for it. I would have assumed XCode would have recommend this solution.

@bparrishMines bparrishMines added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 14, 2022
@auto-submit auto-submit bot merged commit bd81388 into flutter:main Jul 14, 2022
@bparrishMines bparrishMines deleted the content_insets branch July 14, 2022 18:18
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 15, 2022
yutaaraki-toydium pushed a commit to yutaaraki-toydium/plugins that referenced this pull request Aug 12, 2022
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: webview_flutter Edits files for a webview_flutter plugin platform-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[webview_flutter] Bug with scrollView and WebView on iOS

2 participants