Skip to content

Maintain scroll location to prevent content jumping when network images or dynamic network content loads into a listview that has already been laid out #99158

Open
@mark8044

Description

@mark8044

Consider, if there is a ListView with a number of variable height Widgets which further contain network image's that load at their own pace.

When the images load, the height of each individual listview item widget will change (increase) appropriately

If this set of events occurs above the users current scroll position in the listview, then the content will shift / jump. The result is that the user is now looking at content that was formerly above their last viewed position.

This gives for bad user experience.

Is it possible to add a "scroll anchoring" option to listviews (or any scrollable view) that the scroll position should maintain itself relative to the bottom extent of the listview when a layout change occurs above the current position or vice versa when it occurs under neath the current position (as it is currently works). In this way from the user POV, there is not content jumping effect

In the HTML/CSS world this effect has sometimes been called Layout Jank (https://css-tricks.com/the-fight-against-layout-jank/) which has been addressed with various forms of scroll anchoring
(https://blog.chromium.org/2017/04/scroll-anchoring-for-web-developers.html)
(https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-anchor/Guide_to_scroll_anchoring)

https://www.youtube.com/watch?time_continue=15&v=-Fr-i4dicCQ&feature=emb_title

In this case, it would apply to not just a webview but I guess anything that could be controlled by a ScrollContoller?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.d: stackoverflowGood question for Stack Overflowf: scrollingViewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework teamworkaround availableThere is a workaround available to overcome the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions