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

NRPT-167: Autocomplete multiselect fixes #510

Merged
merged 4 commits into from
Jul 23, 2020
Merged

Conversation

dhlevi
Copy link
Contributor

@dhlevi dhlevi commented Jul 22, 2020

Some fixes to correct issues with the multiselect/autocomplete dropdown boxes in the search component.

Corrected the text input so pressing 'enter' with a partial match will select the first item on the list (you don't have to fill out the whole word completely anymore). After selection, the "options" list is cleared, so the list will display again as expected.

There are two approaches to correcting the issue of having the text retained after entering/selecting an option. The issue is that the autocomplete box must be cleared between searches. Retaining the text will prevent the selection box from displaying or any further autocompletes.

To get around this, we have two options. If you have the useChips parameter set to false (the default), your selection text will be applied to the placeholder text of the input box:
image
The one caveat to this approach is that you can't easily see all of your selections once you have several. This issue exists on a regular text box as well of course.

As a secondary option, if you have the useChips parameter set to true, the placeholder text retains its original value, and material chips are added below the input box:
image

Currently all multiselects are set to the defeault (useChips = false) but it's a pretty easy swap if/where preferred.

See ticket NRPT-167

@dhlevi dhlevi requested review from marklise and KitArmstrong July 22, 2020 22:08
Copy link

@danieltruong danieltruong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I would argue we should just set useChips to true. It is vastly superior from a user standpoint.

Copy link
Contributor

@marklise marklise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed looks great! 👍 awesome addition to the multi-select. +1 for useChips = true as the default.

@dhlevi
Copy link
Contributor Author

dhlevi commented Jul 22, 2020

I've changed the default in the FilterObject class to useChips = true. Every autocomplete dropdown should now be using chips! Likely we'll have to do some testing and review to make sure it makes sense... it's pretty easy to change the default or specify some as chips and others as not.

@dhlevi dhlevi merged commit c8f9966 into bcgov:master Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants