You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up from #18019 (fix for #17992). We agreed to do this separately to keep that PR small, see this thread and this one.
What's not great right now
1. The default button is copy-pasted in both combos
combo.component.html and simple-combo.component.html both have the same block inside <igx-combo-add-item>: the @if (addItemTemplate) / @else branch, the default igxButton="flat" button, its focus class binding and the comment explaining it. On top of that, the add item gets a [customTemplate]="!!addItemTemplate" flag only so it knows which branch the parent rendered.
This only works because undefined leaves the class to igxButton's own host binding (_hasKeyboardFocus()). If someone tidies it up to addItem.active, the false wins and the button loses its own keyboard focus ring. A spec in combo.component.spec.ts catches that today, but it's easy to trip over.
Proposal
Let IgxComboAddItemComponent render the default button itself. It already knows active, so the focus state stays inside the component. The combos pass it the custom template instead of the customTemplate flag.
Drive the button's focused look through an input on the button instead of setting igx-button--focused from outside.
The add item component uses an inline <ng-content> template right now. If it renders the button, the template should move to its own .html file (AGENTS.md: no inline templates).
The existing add item specs in combo and simple combo still pass: focus ring on keyboard navigation, button keeps its own focus ring while another item is active, custom template keeps the list item focus style, Enter / click adds the item.
Activity