Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Autocomplete/searchable input field #504

Open
3 tasks done
simberman-gc opened this issue Apr 18, 2024 · 2 comments
Open
3 tasks done

feat: Autocomplete/searchable input field #504

simberman-gc opened this issue Apr 18, 2024 · 2 comments
Labels
development Development tasks enhancement New feature or request

Comments

@simberman-gc
Copy link

simberman-gc commented Apr 18, 2024

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.

  • 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:
    image
    (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?

Provide related code or examples.

image

Add other relevant resources.

No response

@daine daine added the enhancement New feature or request label Apr 22, 2024
@simberman-gc
Copy link
Author

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

@adorayi
Copy link

adorayi commented Sep 27, 2024

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

@daine daine added the development Development tasks label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Development tasks enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants