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

[Android] Webview scroll gets stuck when form autocomplete is displayed #13241

Closed
farazs opened this issue Mar 31, 2017 · 1 comment
Closed
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@farazs
Copy link

farazs commented Mar 31, 2017

Description

On a Android 7.0 high-resolution device, if you have a webview that goes to a page with a form on it, and that form is completed once, the webview saves the form data. When you go to the same form again and tap on a field, the autocomplete suggestion dropdown is displayed and when this happens the webview scrolls to the top and gets stuck there. When trying to scroll down, the webview scrolls a bit and then jumps back to the top.

If you have tap on the screen (removing focus from the form), the autocomplete closes and you can once again scroll normally.

This bug does not occur with a normal Android webview, only with the react-native WebView.

I was not able to reproduce it on a Samsung S5 Android 6.0 or in an emulator, only on the S7 Edge Android 7.0 and Pixel XL Android 7.1.1. It is possible it only occurs on higher resolution device.

Reproduction Steps and Sample Code

Sample react-native app to reproduce: https://github.com/farazs/webview-sample

  1. Install the app on a high resolution Android 7+ device (S7 Edge or Pixel XL so far)
  2. Run the app and you should see https://www.w3schools.com/html/html_forms.asp in the webview
  3. Complete the form and press submit
  4. Close and restart the app
  5. Tap a form field and clear the contents
  6. The autocomplete suggestion dropdown should show up
  7. The webview should now be stuck to the top of the page

Sample native android app where bug is not reproducible: https://github.com/farazs/android-webview-form-sample

Solution

I am not sure why this occurs or what the direct solution is. It seems like some kind of layout bug.

A workaround could be adding a prop to WebView to allow disabling of the autocomplete functionality view.getSettings().setSaveFormData(false);

Additional Information

  • React Native version: 0.42.3
  • Platform: Android
  • Development Operating System: Mac OS X
  • Dev tools: Android Studio 2.3
  • Affected Android OS: Android 7.0 or later
  • Known affected devices: Samsung Galaxy S7 Edge, Google Pixel XL
facebook-github-bot pushed a commit that referenced this issue Apr 10, 2017
Summary:
Adds functionality to be able to disable saving of form data and thereby disabling autocomplete in webview on Android. Can be used as a workaround for #13241

Manual testing that autocomplete is disabled when the property is set to true, and still enabled when it is unset or set to false.
Closes #13271

Differential Revision: D4858899

Pulled By: ericvicenti

fbshipit-source-id: 62738b0685e4c1958c8a32e184fa2fe4f711b336
thotegowda pushed a commit to thotegowda/react-native that referenced this issue May 7, 2017
Summary:
Adds functionality to be able to disable saving of form data and thereby disabling autocomplete in webview on Android. Can be used as a workaround for facebook#13241

Manual testing that autocomplete is disabled when the property is set to true, and still enabled when it is unset or set to false.
Closes facebook#13271

Differential Revision: D4858899

Pulled By: ericvicenti

fbshipit-source-id: 62738b0685e4c1958c8a32e184fa2fe4f711b336
@hramos
Copy link
Contributor

hramos commented Jul 25, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos hramos added the Icebox label Jul 25, 2017
@hramos hramos closed this as completed Jul 25, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Jul 25, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants