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

Autocomplete unresponsive with large options dataset #1317

Closed
jer-0 opened this issue Apr 13, 2023 · 3 comments · Fixed by #1321
Closed

Autocomplete unresponsive with large options dataset #1317

jer-0 opened this issue Apr 13, 2023 · 3 comments · Fixed by #1321
Labels
bug Something isn't working

Comments

@jer-0
Copy link

jer-0 commented Apr 13, 2023

Current Behavior

Hello, svelte animate and transition directive are causing autocomplete to be slow and unresponsive when the options dataset is large.

Steps To Reproduce

stackblitz: https://stackblitz.com/edit/skeletonlabs-repl-wjppky?file=src/routes/+page.svelte

with animate and transition directive removed I didn't notice stuttering:

<li class="autocomplete-item {classesItem}" animate:flip={{ duration }} transition:slide|local={{ duration }}>

Anything else?

tested on google chrome 111 & firefox 111 on windows 11 (Intel(R) Core(TM) i7-9750H CPU )

@jer-0 jer-0 added the bug Something isn't working label Apr 13, 2023
@endigo9740
Copy link
Contributor

endigo9740 commented Apr 13, 2023

@jer-0 we're discussing some ideas for making transition animations both replaceable as well as optional. Very likely off-by-default, given the way it'll work. What we may do is disable the animation for this component temporarily until this new solution can be tested and implemented. Then restore them then.

Just wanted to note this here in case someone else picks up the ticket. Thanks for reporting!

@niktek
Copy link
Contributor

niktek commented Apr 13, 2023

slowdown.mp4

Confirmed on local copy - you can also see some artefacts of the animation towards the end as well

@Hugos68
Copy link
Contributor

Hugos68 commented Sep 7, 2023

Could it be an idea to conditionally enable disable transitions wether they are inside the autocomplete list viewport using intersection observer? You only need to animate those that are in the viewport (usually a max of 15 items or so).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants