-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Description
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
- Install the app on a high resolution Android 7+ device (S7 Edge or Pixel XL so far)
- Run the app and you should see https://www.w3schools.com/html/html_forms.asp in the webview
- Complete the form and press submit
- Close and restart the app
- Tap a form field and clear the contents
- The autocomplete suggestion dropdown should show up
- 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