contentful / forma-36

A design system by Contentful
https://f36.contentful.com
MIT License
334 stars 81 forks source link

💬 Feedback - Autocomplete #2512

Open AndrewLeedham opened 1 year ago

AndrewLeedham commented 1 year ago

Forma 36 component feedback

There is currently no way to defer/debounce updates to items because their internal rendering is dependent on inputValue.

Essentially, I was trying to improve performance of an Autocomplete input that has several thousand items by adding useDeferredValue from React 18 to de-prioritise the dropdown updates over the input updating as a user is typing. However, after implementing this it was not giving the performance gains I was expecting. Doing some performance profiling, this seems to be because AutocompleteItems is re-rendering every-time inputValue changes to include the highlighting for each item, meaning whatever I do the dropdown will always be re-rendered for every inputValue change.

Lelith commented 1 year ago

Hey Andrew, thank you for your feedback. The Autocomplete component is a candidate for a major update in the next version. But we do not yet have a proper roadmap for forma36 v5, so i can't give any dates when it will happen.

In the meantime i can only recommend you, trying to leverage the multiselect component (if you have a multi-select case) or recreate the behaviour using the popover component with an text-input field.

AndrewLeedham commented 1 year ago

Thanks for the response @Lelith. The performance issues aren't urgent, so will probably wait for v5. For context, the reason I am using Autocomplete is because it is suggested when migrating from v3's dropdown.

github-actions[bot] commented 1 year ago

Marking issue as stale since there was no activity for 30 days

github-actions[bot] commented 6 months ago

Marking issue as stale since there was no activity for 30 days