Skip to content

Stop TextFields from wobbling within scrollables - #24015

Merged
HansMuller merged 4 commits into
flutter:masterfrom
HansMuller:textfield_wobble
Nov 7, 2018
Merged

HansMuller merged 4 commits into
flutter:masterfrom
HansMuller:textfield_wobble

Conversation

@HansMuller

@HansMuller HansMuller commented Nov 6, 2018 •

Copy link
Copy Markdown
Contributor

Fixes #20485, #12274

There is an explanation of the problem here #20485 (comment)

Added ScrollPosition.moveTo() which optionally clamps its offset before calling animateTo() or jumpTo(). The moveTo method is actually defined by ViewportOffset (ScrollPosition's superclass) however that method doesn't have enough information to clamp the scroll offset. Ideally ViewportOffset.moveTo() would be abstract (like the other ViewportOffset methods). It has a concrete implementation for the (unlikely) sake of existing ViewportOffset subclasses.

@goderbauer goderbauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with 2 nits.

I believe this also fixes a similar problem during a11y scrolling: #12274

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could the next few lines be replaced by super.moveTo(...)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, yes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably provide a new doc comment for this method, otherwise dartdocs will show the dartdoc of the superclass, which would incorrectly claim that clamp is ignored?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The super class does say

.. but subclasses like [ScrollPosition] handle it by adjusting [to] to prevent over or under scrolling

But you're right, it would clearer if there was new doc here.

@MobilyteApps

Copy link
Copy Markdown

Its still not working on my end. Tried all the solutions on my end but none of the point seems to be working

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scrollview wobbles when text entered into TextField

4 participants