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.
[X] I've searched for existing issues that already report this problem, without success.
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.
We could dump a 380 kB JSON list of ports into >10000 DOM elements inside a gcds-select, ouch.
We could implement an extremely formal UI with a search interface and a "select" button, perhaps in a modal popup:
(though this is a lot of overhead for a very simple piece of information)
We could have the user just type something in, let the system check for an exact match on the list and produce an error if it doesn't (and maybe a success if it does) (the Yahtzee solution)
We could take a string and do the validation in our internal error-management system, but why?
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.
Add other relevant resources.
No response