Skip to content

Conversation

@lekhmanrus
Copy link
Contributor

When using MatChipInput with MatAutocomplete, pressing Enter after typing and selecting an autocomplete option caused two chips to be added - one from the typed text and one from the selected option.
This behavior did not occur when selecting with a mouse click.

This PR updates the chips input handling logic to ensure that only the selected autocomplete option is added when the user confirms the selection.

close #32204, #13574

@lekhmanrus lekhmanrus requested a review from a team as a code owner October 30, 2025 04:17
@lekhmanrus lekhmanrus requested review from andrewseguin and wagnermaciel and removed request for a team October 30, 2025 04:17
@lekhmanrus lekhmanrus force-pushed the fix/32204/material-chips-add-only-active-autocomplete-option-on-selection branch from 54f3573 to 372d20b Compare October 30, 2025 05:56
@angular-robot angular-robot bot added the area: docs Related to the documentation label Oct 30, 2025
@lekhmanrus lekhmanrus changed the title fix(material/chips): add only active autocomplete option on selection docs(material/chips): add only active autocomplete option on selection Oct 30, 2025
@crisbeto crisbeto added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker labels Oct 30, 2025
@crisbeto crisbeto added target: rc This PR is targeted for the next release-candidate and removed target: patch This PR is targeted for the next patch release labels Oct 30, 2025
@crisbeto crisbeto merged commit 943e1e3 into angular:main Oct 30, 2025
32 of 34 checks passed
@crisbeto
Copy link
Member

This PR was merged into the repository. The changes were merged into the following branches:

crisbeto pushed a commit that referenced this pull request Oct 30, 2025
#32208)

* fix(material/chips): add only active autocomplete option on selection

close #32204, #13574

* docs(material/chips): add only active autocomplete option on selection

close #32204, #13574

(cherry picked from commit 943e1e3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: docs Related to the documentation area: material/chips target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(Chips Autocomplete): Selecting an option with Enter adds both input text and selected option as chips

2 participants