cds-snc / gcds-components

GC Design System Components is a monorepo managing the web components of the GC Design System. | « GC Design System Components » (Composants de Système de design GC) est un référentiel unique qui gère les composants Web de Système de design GC.
https://design-system.alpha.canada.ca/
MIT License
35 stars 11 forks source link

feat: Autocomplete/searchable input field #504

Open simberman-gc opened 5 months ago

simberman-gc commented 5 months ago

Prerequisites

Describe the feature request.

We request an input field with an autocomplete/search menu.

Describe the use case.

Here's the current use case: commercial fishers may hail out from one port and hail in to a different port; we must collect both ports in a logbook, and there are >10000 to choose from. We cannot reliably limit the list except to anticipate that fishers hailing out from the Pacific region will not be hailing in to a port on the Atlantic. We would like to have users start typing the name of a port, search that list server-side, and show only potential matches to the user.

Describe the preferred solution.

We are perfectly happy to handle the server communication by ourselves. We would be content with an input that is associated with a menu whose DOM elements we can supply and will be visible when the field is focused. Additionally we would like the normal set of display attributes (required, disabled, error message, force-a-match-or-accept-not-a-match etc). Finally we would like the ability to show one value (Port Name) and commit another (a numerical backing code)

Describe all alternatives.

Provide related code or examples.

image

Add other relevant resources.

No response

simberman-gc commented 5 months ago

For reference, an autocomplete field implemented by a governmental entity: Autocomplete

adorayi commented 1 week ago

Thanks for this. We are reviewing our roadmap to include a component like this for fiscal year 25/26.