Repository navigation
Closed
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: regressionIt was better in the past than it is nowIt was better in the past than it is nowe: device-specificOnly manifests on certain devicesOnly manifests on certain devicesframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packageswaiting for PR to land (fixed)A fix is in flightA fix is in flight
Description
The scroll view wobbles when I type into a TextField that is held inside it.
Steps to Reproduce
- Clone https://github.com/SteveAlexander/flutter_soft_keyboard_bug
- Run it on an iPhone X or simulator
- Notice the scrolling wobbles as you type
$ flutter doctor -v
[✓] Flutter (Channel master, v0.5.9-pre.17, on Mac OS X 10.13.6 17G2208, locale en-GB)
• Flutter version 0.5.9-pre.17 at /Users/steve/code/flutter
• Framework revision 5d8771d18d (16 hours ago), 2018-08-10 21:18:10 -0700
• Engine revision e54bc4ea18
• Dart version 2.0.0-dev.69.5.flutter-eab492385c
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.1)
• Android SDK at /Users/steve/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.4.1, Build version 9F2000
• ios-deploy 1.9.2
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 26.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] VS Code (version 1.25.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.17.1
[✓] Connected devices (1 available)
• iPhone X • 1E0393AA-EF50-42AA-A244-3279599BE2C1 • ios • iOS 11.4 (simulator)
• No issues found!
Reacted by Jerry Chen, Joel Hernández and wongkoo
Metadata
Metadata
Assignees
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: regressionIt was better in the past than it is nowIt was better in the past than it is nowe: device-specificOnly manifests on certain devicesOnly manifests on certain devicesframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packageswaiting for PR to land (fixed)A fix is in flightA fix is in flight
Activity
SteveAlexander commentedon Aug 22, 2018
I think #19523 has regressed
SteveAlexander commentedon Aug 22, 2018
I just verified this against today's Channel master.
flutter doctor -v
[✓] Flutter (Channel master, v0.6.1-pre.47, on Mac OS X 10.13.6 17G2208, locale en-GB)
• Flutter version 0.6.1-pre.47 at /Users/steve/code/flutter
• Framework revision c123312 (2 days ago), 2018-08-20 23:59:37 -0400
• Engine revision 4e845be
• Dart version 2.1.0-dev.1.0.flutter-69fce633b7
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.1)
• Android SDK at /Users/steve/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.4.1, Build version 9F2000
• ios-deploy 1.9.2
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 26.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] VS Code (version 1.26.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.17.1
[✓] Connected devices (1 available)
• iPhone X • 1E0393AA-EF50-42AA-A244-3279599BE2C1 • ios • iOS 11.4 (simulator)
• No issues found!
HansMuller commentedon Aug 23, 2018
Verified that the bug only occurs on iOS
Hixie commentedon Aug 23, 2018
We're computing the position to scroll to incorrectly for some reason.
@SteveAlexander Do you know what build this regressed in?
I don't think this quite reaches the seriousness of a TODAY bug, though I think @zoechi was correct to mark it as such so that we would examine it to determine that. We should definitely fix it ASAP though.
HansMuller commentedon Aug 23, 2018
I'm working on a fix. The problem seems to be that SingleChildScrollView.showOnScreen(), which is called to ensure that the textfield is on screen, is being given a rect whose bounds extend outside the viewport. The iOS BouncingScrollPhysics respond to overscrolls by bouncing, which is what we're seeing here.
You can workaround the problem for the moment by specifying
physics: ClampingScrollPhysics()for the SingleChildChildScrollView.beardo01 commentedon Nov 5, 2018
I am still encountering this issue on
0.10.2. @HansMuller's fix works but I wonder if anyone had any other ideas?Edit: In actual fact, I find
physics: PageScrollPhysics()to be more useful as it doesn't scroll the page back to the start scroll on TextField entry.HansMuller commentedon Nov 5, 2018
@beardo01 Sorry about letting this issue go dark. I've resumed working on the fix.
HansMuller commentedon Nov 5, 2018
The source of the problem is BouncingScrollPhysics, which is the default on iOS. The rect provided to showOnScreen is "inflated" by the TextField's scrollPadding but the result is not clipped to the renderer's paint bounds. This can cause over or underscrolling which causes the bounce.
Here's a platform-neutral demo of the problem.
beardo01 commentedon Nov 7, 2018
Cheers @HansMuller, I see that you've issued a fix which just needs to be merged. Thanks!
yuwen-yan commentedon Mar 12, 2020
Looks we still have this issue when voiceover is on on iOS.
lock commentedon Apr 4, 2020
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, including the output of
flutter doctor -vand a minimal reproduction of the issue.