For now I have only implemented a single event, select, which is fired when the user selects a suggested item in the autocomplete. What other events (if any) do we want to fire?
Possible options/suggestions:
every time a list of results comes back (similar to onChange but with all results)
when no results are found
[x] for errors (rate limiting & network errors)
[x] as the user types (onChange basically)
Customization
I have implemented all autocomplete API params, but I think we should add a couple more customization options, more specifically:
[x] placeholder text for the input field
[x] debounce time (currently set to 300 ms)
[x] autofocus
Do we need anything else to be customizable? This excludes visual changes like styling, dark mode, icons, etc, see below
Transitions / Animations
Do we want to add any of this? Notably Algolia Places does not have any either. I personally like not having animations as they very easily make the UI feel sluggish.
Clear button
We could add a little x button on the right to clear the input field.
Loading spinner
We could add a spinner animation for when the component is fetching results (#2)
No results
We don’t currently show a "no results found" message (and neither does the algolia places demo). Is this necessary?
Icons for different result types
Briefly discussed in Slack, we could vary the icon next to a result depending on its type. For example a train for train stations, a city for cities, etc.
Use browser location
We could allow using the user’s location through the browser API as is implemented in the component on our website.
Potential features after release
style customization (either fully through CSS or maybe through themes)
dark mode support for default theme
autofocus attribute
[x] We should pass down the autofocus attribute as is expected for text input fields
add request header with component version
we could add a header to every request which would contain the version of the autocomplete component, which we could use to gain some insight into how many requests are made using the component as well if people upgrade the version etc
Events
For now I have only implemented a single event,
select
, which is fired when the user selects a suggested item in the autocomplete. What other events (if any) do we want to fire?Possible options/suggestions:
Customization
I have implemented all autocomplete API params, but I think we should add a couple more customization options, more specifically:
300 ms
)Do we need anything else to be customizable? This excludes visual changes like styling, dark mode, icons, etc, see below
Transitions / Animations
Do we want to add any of this? Notably Algolia Places does not have any either. I personally like not having animations as they very easily make the UI feel sluggish.
Clear button
We could add a little
x
button on the right to clear the input field.Loading spinner
We could add a spinner animation for when the component is fetching results (#2)
No results
We don’t currently show a "no results found" message (and neither does the algolia places demo). Is this necessary?
Icons for different result types
Briefly discussed in Slack, we could vary the icon next to a result depending on its type. For example a train for train stations, a city for cities, etc.
Use browser location
We could allow using the user’s location through the browser API as is implemented in the component on our website.
Potential features after release
autofocus attribute
autofocus
attribute as is expected for text input fieldsadd request header with component version
we could add a header to every request which would contain the version of the autocomplete component, which we could use to gain some insight into how many requests are made using the component as well if people upgrade the version etc