Skip to content

scrollview wobbles when text entered into TextField #20485

Closed

Description

@SteveAlexander

The scroll view wobbles when I type into a TextField that is held inside it.

Steps to Reproduce

  1. Clone https://github.com/SteveAlexander/flutter_soft_keyboard_bug
  2. Run it on an iPhone X or simulator
  3. 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!

Activity

  1. SteveAlexander commented on Aug 22, 2018

    @SteveAlexander
    Author

    I think #19523 has regressed

  2. SteveAlexander commented on Aug 22, 2018

    @SteveAlexander
    Author

    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!

  3. added
    a: text inputEntering text in a text field or keyboard related problems
    c: regressionIt was better in the past than it is now
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    on Aug 23, 2018
  4. HansMuller commented on Aug 23, 2018

    @HansMuller
    Contributor

    Verified that the bug only occurs on iOS

  5. Hixie commented on Aug 23, 2018

    @Hixie
    Contributor

    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.

  6. HansMuller commented on Aug 23, 2018

    @HansMuller
    Contributor

    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.

  7. self-assigned this
    on Aug 27, 2018
  8. beardo01 commented on Nov 5, 2018

    @beardo01

    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.

  9. HansMuller commented on Nov 5, 2018

    @HansMuller
    Contributor

    @beardo01 Sorry about letting this issue go dark. I've resumed working on the fix.

  10. HansMuller commented on Nov 5, 2018

    @HansMuller
    Contributor

    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.

  11. beardo01 commented on Nov 7, 2018

    @beardo01

    Cheers @HansMuller, I see that you've issued a fix which just needs to be merged. Thanks!

  12. yuwen-yan commented on Mar 12, 2020

    @yuwen-yan
    Contributor

    Looks we still have this issue when voiceover is on on iOS.

  13. lock commented on Apr 4, 2020

    @lock

    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 -v and a minimal reproduction of the issue.

  14. locked and limited conversation to collaborators on Apr 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: text inputEntering text in a text field or keyboard related problemsc: regressionIt was better in the past than it is nowe: device-specificOnly manifests on certain devicesframeworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packageswaiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions