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

✨ Virtualized autocomplete #2689

Merged
merged 31 commits into from
Dec 20, 2022

Conversation

oddvernes
Copy link
Collaborator

resolves #1909

Remains to figure out a musterious error message in storybook and look into if i can make virtualization optional (its a bit decentralized with changes various placed that would need to be toggled)

@oddvernes oddvernes marked this pull request as ready for review December 14, 2022 15:06
@oddvernes
Copy link
Collaborator Author

I added a multiline prop which is false by default. This is mainly relevant if someone have autoWidth set and the text overflows. By default text is cut off with ellipsis, but when you add multiline the text will wrap. This also changes virtualizer settings to measure height per item, so it adds a bit of performance overhead. The old behaviour was always wrap, but then we didnt have the performance penalty either.

I am uncertain if i should add a virtualizerOverscan prop or leave it hardcoded at 25. It sets how many elements are rendered above and below visible viewport. Lower numbers introduce glitchy appearance when scrolling fast as items struggle to render fast enough, while with bigger numbers the scrolling is mostly fine but adds more up front delay on opening/searching/dragging scrollbar. I find 25 to be a good compromize but perhaps users would want more control over this?

@oddvernes
Copy link
Collaborator Author

There was an issue where autocomplete items would not resize when switching between comfortable and compact, but I found a workaround for this.

Finally the last outstanding issue, in the storybook Autocomplete stories, at least when running locally you'll probably see this in the console everytime opening the dropdown:
bilde
This is some bug in storybook where window.onerror is captured but fails to send as xhr
bilde
If I intercept this window.onerror myself, it turns out the error is ResizeObserver loop limit exceeded. It means ResizeObserver was not able to deliver all observations within a single animation frame. It is benign and can be ignored.

@oddvernes oddvernes force-pushed the 1909-virtualized-autocomplete-test-release branch from a19d559 to 066a3a8 Compare December 19, 2022 12:30
Copy link
Contributor

@denektenina denektenina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@oddvernes oddvernes merged commit 9fe38c6 into develop Dec 20, 2022
@oddvernes oddvernes deleted the 1909-virtualized-autocomplete-test-release branch December 20, 2022 12:16
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 this pull request may close these issues.

Support large data sets in Autocomplete
2 participants