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

[ComboBox]: can I allow an onBlur to trigger the onChange event of a Combobox for a new item entry? #6999

Open
scottdickerson opened this issue Oct 8, 2020 · 2 comments
Labels
component: combobox package: react carbon-components-react proposal: open This request has gone through triaging. We're determining whether we take this on or not. type: enhancement 💡

Comments

@scottdickerson
Copy link
Contributor

Summary

As I user, I expect ComboBox to work like a TextInput for newly Items, blurring the field should trigger the onChange event. Could we add a property to the ComboBox control to allow them to work like that? Similar to this bug:
#6613

image

Justification

For our usecases, we mostly want to use ComboBox to enter new items, but occasionally to select an existing item.

Desired UX and success metrics

As a user I am able to submit new items to the ComboBox simply by entering new text, and then leaving the field

@tay1orjones
Copy link
Member

This is supported by the wai-aria guidance:

The nature of the suggested values and the way the suggestions are presented is called the autocomplete behavior. Comboboxes can have one of four forms of autocomplete:

  1. No autocomplete: When the popup is triggered, the suggested values it contains are the same regardless of the characters typed in the textbox. For example, the popup suggests a set of recently entered values, and the suggestions do not change as the user types.
  2. List autocomplete with manual selection: When the popup is triggered, it presents suggested values that complete or logically correspond to the characters typed in the textbox. The character string the user has typed will become the value of the textbox unless the user selects a value in the popup.
  3. List autocomplete with automatic selection: When the popup is triggered, it presents suggested values that complete or logically correspond to the characters typed in the textbox, and the first suggestion is automatically highlighted as selected. The automatically selected suggestion becomes the value of the textbox when the combobox loses focus unless the user chooses a different suggestion or changes the character string in the textbox.
  4. List with inline autocomplete: This is the same as list with automatic selection with one additional feature. The portion of the selected suggestion that has not been typed by the user, a completion string, appears inline after the input cursor in the textbox. The inline completion string is visually highlighted and has a selected state.

The current implementation doesn't follow any of these specifically, more of a blend of #2 and #3. This request would firmly plant the implementation in #3.

@grahamharper
Copy link

@tay1orjones Firstly I would give +1 for #3.

But also those 4 patterns you quoted deal with the selection behaviour, I think the original issue description deals more with the other expected behaviour of combobox, that it also behaves like a text input and allow input of arbitrary text, text that does not match an option in the list.

I believe this is what's asked for in #6102 and #6818

@sstrubberg sstrubberg added the proposal: open This request has gone through triaging. We're determining whether we take this on or not. label Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: combobox package: react carbon-components-react proposal: open This request has gone through triaging. We're determining whether we take this on or not. type: enhancement 💡
Projects
Status: Later 🧊
Development

No branches or pull requests

5 participants