-
Notifications
You must be signed in to change notification settings - Fork 58
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
[group] control scroll position #43
Comments
attempting to create a "scrollTo" method, that scrolls an element by index at
|
solved problems to this point:
tested in firefox |
update: after almost giving up fixing the remaining issue (adjust scroll position when filter list) I finally solved it! The demo has been updated and next I'd like to do a PR with clean code So @Rich-Harris maybe now is a good time to get your attention :) My proposal:
Any thoughts before I start coding? |
Here is a webm of the demo 👼 |
Very nice. Thanks! Apparently your |
great work! |
I am preparing a pull request. Fork, cleanup, testing is done. One issue remains in logs:
How to properly expose a function / "method" so it can be called from outside? I played with update: <script>
export let scrollToIndex = () => {} // this should be "undefined"
</script>
<div class="List">
<VirtualList {items}
bind:start
bind:end
bind:scrollToIndex
let:item
>
<ListItem {item}/>
</VirtualList>
</div> initializing with explicit updating demo and opening PR shortly 👀 |
ℹ️ published fork |
This is a summary of issues around similar use-cases:
I hope the use-case-namings are helpful - all these issues have in common, that we expect certain behaviours from the scroll position. To prevent solving one issue while re-creating another, I suggest to work towards one PR that solves them together 🚄 🤝
REPL: https://svelte.dev/repl/1c36db7c1e7e4ef2bfb04874321412e5?version=3.20.1
comparable vanilla implementations:
The text was updated successfully, but these errors were encountered: