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

Webview's Web page scroll area shrinks on Ios safari when redirect with keypad opened #1862

Closed
2 tasks done
qkreltms opened this issue Nov 9, 2023 · 3 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@qkreltms
Copy link

qkreltms commented Nov 9, 2023

  • I have read the Getting Started section
  • I have already searched for the same problem

Environment

Technology Version
Flutter version 3.13.9
Plugin version 6.0.0-beta.22 and 6.0.0-beta.25
Android version
iOS version 16.6.1
macOS version
Xcode version 14.3

Device information: iphone 14

Description

I have page A and B
and A page has input tag in it.
B page has height like 9999px with scroll area.

When I'm at page A with input tag focused. The keypad will open.
image

And then when I type someting like 1234, then will be redirected to page B automatically.

Expected behavior:
webview scroll area should scrollable 0 to 9999px;

Current behavior:
webview scroll area scrollable 0 to 9999px - 300px (keypad height); * page's height is still 9999px
It seems webview dosen't calculate scrollable area properly in this case.

Steps to reproduce

Should have resizeToAvoidBottomInset: false

Scaffold(
            resizeToAvoidBottomInset: !Platform.isIOS,
            appBar: VisibleAppBar(),
            body: InAppWebView(...),
            bottomNavigationBar: const Footer()));

Redirect page A to B with keypad opened in ios

Images

Stacktrace/Logcat

@qkreltms qkreltms added the bug Something isn't working label Nov 9, 2023
Copy link

github-actions bot commented Nov 9, 2023

👋 @qkreltms

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

@qkreltms qkreltms changed the title Web page scroll area shrinks on Ios safari when redirect with keypad opened WebviewWeb page scroll area shrinks on Ios safari when redirect with keypad opened Nov 9, 2023
@qkreltms qkreltms changed the title WebviewWeb page scroll area shrinks on Ios safari when redirect with keypad opened Webview's Web page scroll area shrinks on Ios safari when redirect with keypad opened Nov 9, 2023
@pichillilorenzo
Copy link
Owner

That's because you have set resizeToAvoidBottomInset to false for iOS.
If you close the keyboard, you should see the webpage.
As you can see from the Flutter official doc of Scaffold.resizeToAvoidBottomInset, you need to set it to true:

For example, if there is an onscreen keyboard displayed above the scaffold, the body can be resized to avoid overlapping the keyboard, which prevents widgets inside the body from being obscured by the keyboard.

Copy link

github-actions bot commented Oct 6, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants