Skip to content

[Bug]: Combobox doesn't close when arrow is clicked #30693

Open

Description

@joriverm

Library

Web Components (@fluentui/web-components)

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
    Memory: 16.78 GB / 31.20 GB
  Browsers:
    Edge: Chromium (122.0.2365.66)
    Internet Explorer: 11.0.19041.3636

the command lies, I use Firefox 123.0 (64-bit) as my main browser but this can be replicated on the others too

Are you reporting Accessibility issue?

None

Reproduction

https://learn.microsoft.com/en-us/fluent-ui/web-components/components/combobox?pivots=typescript
its a basic fluent-combobox web component, so for short :

<h3>Default</h3>
<fluent-combobox placeholder="Select a graphics card">
  <fluent-option value="1">GTX 1060</fluent-option>
  <fluent-option value="2">GTX 1070</fluent-option>
  <fluent-option value="3">GTX 1080</fluent-option>
  <fluent-option value="4" disabled>GTX 1090</fluent-option>
</fluent-combobox>
www_screencapture_com_2024-3-4_09_02.webm

Bug Description

Actual Behavior

Combobox doesn't close

Expected Behavior

Combobox to close

Logs

No response

Requested priority

High

Products/sites affected

client blazor application that is using Fluent Blazor

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Activity

  1. added
    Resolution: Soft Close
    on Sep 1, 2024
  2. hml-coder commented on Jan 11, 2025

    @hml-coder

    When the combobox list is visible, the clickHandler does not check if the dropdown indicator was clicked. It only checks:

    1. whether an option was selected
    2. the Escape key was pressed
    3. focus was lost

    There's also some focus logic that looks like it might be interfering with the dropdown closing.

    public clickHandler(e: MouseEvent): boolean | void {
            if (this.disabled) {
                return;
            }
    
            if (this.open) {
                const captured = (e.target as HTMLElement).closest(
                    `option,[role=option]`
                ) as ListboxOption | null;
    
                if (!captured || captured.disabled) {
                    return;
                }
    
                this.selectedOptions = [captured];
                this.control.value = captured.text;
                this.clearSelectionRange();
                this.updateValue(true);
            }
    
            this.open = !this.open;
    
            if (this.open) {
                this.control.focus();
            }
    
            return true;
    }
    

    I'm not comfortable doing a PR but if anyone is interested and has time then a fix might be something like:

    public clickHandler(e: MouseEvent): boolean | void {
        if (this.disabled) {
            return;
        }
    
        // check if the dropdown indicator was clicked
        if ((e.target as HTMLElement).closest('[part="indicator"]')) {
            this.open = !this.open; 
            return true;
        }
    
        if (this.open) {
            const captured = target.closest(`option,[role=option]`) as ListboxOption | null;
    
            if (!captured || captured.disabled) {
                return;
            }
    
            this.selectedOptions = [captured];
            this.control.value = captured.text;
            this.clearSelectionRange();
            this.updateValue(true);
            // close the list
            this.open = false;
        }
    
        if (this.open) {
            this.control.focus();
        }
    
        return true;
    }
    
  3. vnbaaij commented on Feb 7, 2025

    @vnbaaij
    Contributor
  4. microsoft-github-policy-service commented on Aug 7, 2025

    @microsoft-github-policy-service

    This issue has not had activity for over 180 days! We're adding Soft close label and will close it soon for house-keeping purposes.
    Still require assistance? Please add comment - "keep open".

  5. joriverm commented on Aug 7, 2025

    @joriverm
    Author

    keep open, see comment by vincent above

  6. microsoft-github-policy-service commented on Feb 3, 2026

    @microsoft-github-policy-service

    This issue has not had activity for over 180 days! We're adding Soft close label and will close it soon for house-keeping purposes.
    Still require assistance? Please add comment - "keep open".

  7. microsoft-github-policy-service commented on Sep 24, 2026

    @microsoft-github-policy-service

    This issue has not had activity for over 180 days! We're adding Soft close label and will close it soon for house-keeping purposes.
    Still require assistance? Please add comment - "keep open".

  8. microsoft-github-policy-service commented on Sep 24, 2026

    @microsoft-github-policy-service

    This issue has not had activity for over 180 days! We're adding Soft close label and will close it soon for house-keeping purposes.
    Still require assistance? Please add comment - "keep open".

  9. chrisdholt commented on Sep 24, 2026

    @chrisdholt
    Member

    keep open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Resolution: Soft Closeweb-components

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions