open-ui icon indicating copy to clipboard operation
open-ui copied to clipboard

[combobox] when should the picker open and close?

Open josepharhar opened this issue 1 month ago • 3 comments

The APG guide lists some possible behaviors for opening and closing the picker:

  • It is displayed when the Down Arrow key is pressed or the Open button is activated. Optionally, if the combobox is editable and contains a string that does not match an allowed value, expansion does not occur.
  • It is displayed when the combobox receives focus even if the combobox is editable and empty.
  • If the combobox is editable, the popup is displayed only if a certain number of characters are typed in the combobox and those characters match some portion of one of the suggested values.

The existing <input> with <datalist> opens its picker when it is focused. Does that seem like a reasonable behavior? Should it be controllable?

The input element will hopefully have a ::picker-icon pseudo-element. Should clicking it open the picker, or should clicking anywhere in the input element show the picker instead? This could also happen when the input element is already focused after picking an option, if picking an option closes the picker.

Should picking an option close the picker? It seems like a reasonable default to me.

Should typing in something which doesn't match anything close the picker? Or should it leave an ugly empty box there in hopes that the author provides some sort of placeholder for no options matching? Or keep the popover open but make it look invisible? There should probably be a separate issue for a no options matching placeholder option/text.

Should pressing the down arrow open the picker in the case that the input is focused and the picker isn't already showing?

josepharhar avatar Nov 03 '25 20:11 josepharhar

The existing with opens its picker when it is focused. Does that seem like a reasonable behavior? Should it be controllable?

Does it? It's not working for me? For me it opens on click.

If down arrow activates the picker what do we do for <input type="number">? Currently they're not keyboard accessible for number inputs.

lukewarlow avatar Nov 04 '25 13:11 lukewarlow

Our customers expect it not to open on focus as they want to for example tab through form and if dropdown open it confuse them. They want it to open on clicking arrow down or when they start typing

W dniu wt., 4 lis 2025 o 14:32 Luke Warlow @.***> napisał(a):

lukewarlow left a comment (openui/open-ui#1320) https://github.com/openui/open-ui/issues/1320#issuecomment-3486023921

The existing with opens its picker when it is focused. Does that seem like a reasonable behavior? Should it be controllable?

Does it? It's not working for me?

— Reply to this email directly, view it on GitHub https://github.com/openui/open-ui/issues/1320#issuecomment-3486023921, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFKBQQOUSCD7F3NLLIEKM2333CTIHAVCNFSM6AAAAACLA2ZZUWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIOBWGAZDGOJSGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

kbrilla avatar Nov 04 '25 13:11 kbrilla

Does it? It's not working for me? For me it opens on click.

Ah you're right, clicking anywhere in the input opens the picker but focusing with the keyboard does not.

If down arrow activates the picker what do we do for <input type="number">? Currently they're not keyboard accessible for number inputs.

I haven't really considered other inputs besides text. That's a good point since the down arrow decrements the value in the number input.

Our customers expect it not to open on focus as they want to for example tab through form and if dropdown open it confuse them. They want it to open on clicking arrow down or when they start typing

This matches the current behavior, so I think we should go with that.

josepharhar avatar Nov 04 '25 16:11 josepharhar