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

Viewport goes empty if scrolled down and items array changes. #30

Open
kevmodrome opened this issue Oct 6, 2019 · 1 comment · May be fixed by #52
Open

Viewport goes empty if scrolled down and items array changes. #30

kevmodrome opened this issue Oct 6, 2019 · 1 comment · May be fixed by #52

Comments

@kevmodrome
Copy link

So I decided to try to work with this component and add a filteredItems function that filters depending on some input.

It appears as though the viewport is not scrolled to the top when the items array changes which results in some weird behaviour. I have showcased it in this REPL

To reproduce, scroll down some hundreds of items and start writing something in the input field.

The solution is simple and I will make a PR.

@jdevine
Copy link

jdevine commented Jan 17, 2020

I mucked about some and saw that a change to items was running refresh but relying on stale info, so I made the change to items reset start and end if they are now out of range. There may be some duplicate calls going on, but as a quick and dirty it seems to work:

REPL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants