geocodeearth / autocomplete-element

A custom element for use with the Geocode Earth Autocomplete API.
https://geocode.earth
MIT License
8 stars 1 forks source link

Initial release & roadmap #1

Closed mxlje closed 3 years ago

mxlje commented 3 years ago

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:

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

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

mxlje commented 3 years ago

I think we can close this and pick up individual items in separate discussions, if necessary.