Skip to content

Core Combobox clear button bypasses read-only state #14701

Description

@InnaAtanasova

When a Core Combobox (fd-combobox) has both [readOnly]="true" and [showClearButton]="true", the clear (X) button still clears the value. Clicking it (or pressing Enter on it) empties the control, propagates the change, and marks the form dirty — even though the combobox is read-only.

Typing and arrow/enter selection are correctly blocked when read-only; only the clear button is unguarded.

Expected behavior

  • With readOnly set, the clear button must not change the value, mark the control dirty, or emit changes.
  • Programmatic updates (setValue, patchValue, writeValue, reset) still work while read-only.

Current behavior

  • _handleClearSearchTerm() clears the text and calls _propagateChange() with no readOnly check, so the clear button wipes a read-only value.

Steps to reproduce

  1. Set up an fd-combobox with [readOnly]="true" and [showClearButton]="true", seeded with a value (e.g. Apple).
  2. Click the clear (X) button (or focus it and press Enter).
  3. The value is cleared and the control is marked dirty.

Scope

  • Core Combobox (fd-combobox). The clear button only renders whenshowClearButton is enabled (off by default), so this affects comboboxes that opt into it.

Notes

This example was temporary created to illustrate the problem

Screenshot 2026-11-20 at 2 20 02 PM https://github.com/user-attachments/assets/13d802c8-d765-4650-8e14-31e516f30b85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions