Skip to content

Conversation

mistrykaran91
Copy link
Contributor

Currently, when we have some initial value in form control those are not marked as selected, this fix will check the initial value and if its matched, will be marked as selected.

Fixes #29422

@mistrykaran91 mistrykaran91 requested a review from a team as a code owner April 14, 2025 13:42
@mistrykaran91 mistrykaran91 requested review from mmalerba and wagnermaciel and removed request for a team April 14, 2025 13:42
@mistrykaran91 mistrykaran91 force-pushed the fix/highlgiht-value-in-options-with-check-icon branch 2 times, most recently from c47259e to 81b722a Compare June 9, 2025 09:29
@mistrykaran91 mistrykaran91 force-pushed the fix/highlgiht-value-in-options-with-check-icon branch from 81b722a to 1478c8d Compare June 27, 2025 10:01
@mistrykaran91 mistrykaran91 force-pushed the fix/highlgiht-value-in-options-with-check-icon branch from 1478c8d to bb4452b Compare September 27, 2025 05:57
…trol

Currently, when we have some initial value in formcontrol those are not marked as selected, this fix will check the initial value and if its matched, will be marked as selected.

Fixes angular#29422
@mistrykaran91 mistrykaran91 force-pushed the fix/highlgiht-value-in-options-with-check-icon branch from bb4452b to 1a4e9ea Compare September 27, 2025 08:10
@mistrykaran91
Copy link
Contributor Author

@mmalerba @wagnermaciel: It will be helpful if this can be looked into :)

@mmalerba mmalerba added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Sep 29, 2025
);
if (selectedOption && !selectedOption.selected) {
selectedOption.select(false);
this._changeDetectorRef.detectChanges();
Copy link
Contributor

Choose a reason for hiding this comment

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

does markForCheck() work here? we generally try to avoid directly calling detectChanges()

@mmalerba mmalerba removed the action: merge The PR is ready for merge by the caretaker label Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/autocomplete target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(Autocomplete): matAutocomplete with control initial value does not highlight value in options with check icon
2 participants