Skip to content

fix(combo): show flat button focus on default add item - #18019

Open
onlyexeption wants to merge 3 commits into
masterfrom
ibarakov/fix-17992
Open

onlyexeption wants to merge 3 commits into
masterfrom
ibarakov/fix-17992

Conversation

@onlyexeption

@onlyexeption onlyexeption commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #17992

Description

The default "Add item" button no longer takes the dropdown's focused-item background or outline when it is reached with the keyboard. It now shows the theme's flat button focus state.

  • IgxComboAddItemComponent: the default add item no longer reports itself as a focused list item. A new internal active getter carries the active state.
  • Combo and Simple Combo templates: the default button binds igx-button--focused while the add item is active, so it picks up each theme's flat button focus styles. No SCSS changes.
  • Custom igxComboAddItem templates are unchanged.

Motivation / Context

The add item wrapper got igx-drop-down__item--focused, which painted a list-item fill or outline behind the flat button, e.g. solid gray in Bootstrap dark and an outline in Indigo. The fill depended on which stylesheet loaded last, so it showed in some apps and not in others.

Type of Change (check all that apply):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog
  • Skills/Agents

Component(s) / Area(s) Affected:

Combo, Simple Combo

How Has This Been Tested?

  • Unit tests
  • Manual testing
  • Automated e2e tests

New specs cover the no-match and partial-match keyboard paths, the Simple Combo, and an unchanged custom template. All Combo, Simple Combo and Drop Down specs pass (454). Checked manually in the demo with Bootstrap dark.

Test Configuration:

  • Angular version: 22.2.3
  • Browser(s): Chrome, Chromium (Playwright)
  • OS: Windows 11

Screenshots / Recordings

Checklist:

  • All relevant labels have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The changes suppress native keyboard-focus styling in both Combo variants and introduce unrelated global theme changes and removal of the custom add-item sample template.

3 open issues
What changed in this PR

Addresses #17992 by giving the default “Add item” button the theme’s flat-button focus styling in Combo and Simple Combo, while preserving custom-template styling.

Changes:

  • Separates the add item’s active state from its list-item focus styling.
  • Adds keyboard-focus and custom-template regression tests, plus a changelog entry.
  • Changes the demo to dark Bootstrap and temporarily disables its custom add-item template for verification.
File Description
src/​styles/​_variables.scss Switches the global demo theme and typography to dark Bootstrap.
src/​app/​combo/​combo.sample.html Comments out the custom add-item template to expose the default button.
projects/​igniteui-angular/​simple-combo/​src/​simple-combo/​simple-combo.component.spec.ts Adds default-button keyboard-focus coverage.
projects/​igniteui-angular/​simple-combo/​src/​simple-combo/​simple-combo.component.html Binds the default button’s focus class to the add item’s active state.
projects/​igniteui-angular/​combo/​src/​combo/​combo.component.spec.ts Covers default-button focus transitions and preserved custom-template styling.
projects/​igniteui-angular/​combo/​src/​combo/​combo.component.html Applies button focus styling while retaining custom-template rendering.
projects/​igniteui-angular/​combo/​src/​combo/​combo-add-item.component.ts Adds active-state tracking and limits list-item focus styling to custom templates.
CHANGELOG.md Documents the corrected Add item focus appearance.

Review effort: Balanced

Comment thread src/app/combo/combo.sample.html Resolved
Comment thread src/styles/_variables.scss Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the Combo and Simple Combo add-item focus-styling update.

No open issues 🎉

3 resolved since last review

Review effort: Balanced

@IMinchev64 IMinchev64 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this locally against master with a small repro page (bootstrap dark/light, material, indigo, fluent, plus simple combo and a custom template). The gray fill / indigo outline is gone and the button gets its proper focus ring in every theme, nice. Custom template still keeps the old item focus look, Enter still adds the item, partial match works too. Combo + simple combo specs pass locally.

One thing though: the "focused without pressing anything" part of #17992 still happens in the simple combo, it just looks different now. Details inline, the rest is small stuff.

@IMinchev64 IMinchev64 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidentally left my review as comments XD, so requesting changes with this one. Main blocker is the simple combo stale focus thing (see inline comment), the rest are nits.

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Combo: the focused "Add item" fills with the list item's focus background

3 participants