Skip to content

Create a way to control whether a scroll view resets scroll position on update #83

Open
@stackotter

Description

@stackotter

In some circumstances (e.g. when switching out the contents of an article view with a new article) it makes sense for a scroll view to reset its scroll position to the top, and in other circumstances (e.g. a text editor) it makes more sense for a scroll view to maintain its scroll position when its contents are updated. SwiftUI defaults to the latter option (cause even when it's not the best option, it's still usable).

SwiftUI currently has no API for this (afaik), so we get to make up something ourselves 🥳 suggestions welcome!

If there's a workaround for this in SwiftUI I'd be interested to know what it is, because perhaps the workaround is how you're meant to do things in the first place (but I still think that this API would be useful either way).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions