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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nimble combobox list option is not opening the first time you type #1324

Closed
codrutaserban opened this issue Jun 26, 2023 · 3 comments 路 Fixed by #1507
Closed

Nimble combobox list option is not opening the first time you type #1324

codrutaserban opened this issue Jun 26, 2023 · 3 comments 路 Fixed by #1507
Assignees
Labels
bug Something isn't working client request Client team would immediately benefit from this change

Comments

@codrutaserban
Copy link

codrutaserban commented Jun 26, 2023

馃悰 Bug Report

In a slide-out the combobox is the first input and when it opens the focus is on the combobox and you can start writing. The problem is the option list doesn't open after you type. It works if the combobox lose focus and you click on it again.

馃捇 Repro or Code Sample

These are the inputs:
<nimble-combobox *ngIf="showAutocomplete" #id formControlName="..." autocomplete="none" appearance="underline" placeholder="Path *" [error-text]="..." [error-visible]="abstractControl.touched && abstractControl.invalid">

馃 Expected Behavior

The option list should open when you start typing.

馃槸 Current Behavior

When you open the slide-out, even that you can type right away the option list doesn't open.
The problem seems to be that the open attribute is not set when you start typing and it is the one that makes the nimble-anchored-region become visible.

current behaviour

馃拋 Possible Solution

馃敠 Context

This happens when you open the slide-out and the component is already on focus (is the first input) and doesn't detect I am typing.

馃實 Your Environment

@codrutaserban codrutaserban added bug Something isn't working triage New issue that needs to be reviewed labels Jun 26, 2023
@ipopa144
Copy link

ipopa144 commented Jun 26, 2023

This is reproducible only when the combobox is used with autocomplete="none" option. When used with autocomplete="both", it works as expected. See the sl-workspace-selector component for reference.

workspace-selector

@jattasNI jattasNI changed the title Nimble combobox list option is not opening the fist time you type Nimble combobox list option is not opening the first time you type Jun 26, 2023
@jattasNI jattasNI added client request Client team would immediately benefit from this change and removed triage New issue that needs to be reviewed labels Jun 27, 2023
@atmgrifter00
Copy link
Contributor

atmgrifter00 commented Jul 11, 2023

@codrutaserban @ipopa144, I want to point out that the current behavior of the Combobox when its autocomplete setting is either none or inline I would call "expected". As you can see in FAST's Combobox implementation, they are very explicit about which mode should open up the dropdown if it is currently closed while typing.

While this isn't on its own proving that this is proper behavior, I believe we can find reason behind it from the purpose of the autocomplete settings. For the both and list options, they are actively performing filtering on a list of options, which would suggest a user would need to see the options being filtered as they type. For inline and none no filtering is taking place, and thus the "hints" that the dropdown is providing aren't necessary as they aren't changing as the user types (and they can always show the dropdown by pressing the down arrow).

This is problematic for your particular use-case, I believe, because you are applying your own custom filtering (and updating the actual list options in the DOM based on what the user types), and thus, while your autocomplete is technically none you are trying to create a behavior aligned with the list behavior.

To help solve your particular use-case, I would propose we expose the open attribute on the Angular NimbleComboboxDirective, and then an application can listen to the input event on the combobox, and update the open attribute explicitly as needed. Does this sound reasonable?

@m-akinc m-akinc closed this as completed Aug 15, 2023
@m-akinc m-akinc reopened this Aug 15, 2023
@ipopa144
Copy link

The current workaround that we found is to set the open attribute on the native element, so exposing it on the angular NimbleComboboxDirective would make our code cleaner.

However, our expactation was this to be the default behaviour. If the dropdown is opened when clicking on the unfocused combobox with autocomplete="none", I was expecting the dropdown to open when the user starts typing as well.

@atmgrifter00 atmgrifter00 linked a pull request Sep 8, 2023 that will close this issue
1 task
atmgrifter00 added a commit that referenced this issue Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client request Client team would immediately benefit from this change
Projects
Development

Successfully merging a pull request may close this issue.

5 participants