The autocomplete component is currently just over 700 lines long and handles multiselect, loading of the options dynamically with the use of onChange and using static options which are then either filtered inside the autocomplete or with an external function using the search parameter. The reason for this refactor would be to reduce the code complexity and hopefully the size of the components so that they are easier to work on in the future.
The two new components would be DynamicAutocomplete and StaticAutoComplete, the main difference between the two components is how they handle filtering and the loading of options.
The dynamic autocomplete would have all filtering external to the component, done by the user, and the user would then update the options property to give the new results. Whereas the static autocomplete options property never changes it's value after it has received the data. The filtering can be done either externally or internally to the component however the options value is never updated by the user.
These two components would still need to handle the current functionality of switching to a form select if the user has turned off javascript and all of the accessibility features that have been added recently. The two components would NOT include the multiselect functionality which would be split off into it's own component in a separate ticket.
Tasks
Autocomplete to be marked as deprecated
Two new components to be created based off of the existing autocomplete, DynamicAutoComplete and StaticAutocomplete. (StaticAutocomplete can be created first as a base so that DynamicAutocomplete can extend the component)
Updated documentation and tests for the components as well as updated examples in storybook.
The autocomplete component is currently just over 700 lines long and handles multiselect, loading of the options dynamically with the use of onChange and using static options which are then either filtered inside the autocomplete or with an external function using the search parameter. The reason for this refactor would be to reduce the code complexity and hopefully the size of the components so that they are easier to work on in the future.
The two new components would be DynamicAutocomplete and StaticAutoComplete, the main difference between the two components is how they handle filtering and the loading of options. The dynamic autocomplete would have all filtering external to the component, done by the user, and the user would then update the options property to give the new results. Whereas the static autocomplete options property never changes it's value after it has received the data. The filtering can be done either externally or internally to the component however the options value is never updated by the user.
These two components would still need to handle the current functionality of switching to a form select if the user has turned off javascript and all of the accessibility features that have been added recently. The two components would NOT include the multiselect functionality which would be split off into it's own component in a separate ticket.
Tasks
Please follow these steps to create your branch: