Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stackotter opened this issue Apr 9, 2024 · 0 comments
Labels
API enhancement New feature or request

Comments

@stackotter
Copy link
Owner

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).

@stackotter stackotter added enhancement New feature or request API labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant