Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(material/autocomplete): regression in requireSelection when options are filtered #28119

Merged

Conversation

crisbeto
Copy link
Member

In #27781 the call to capture the input value was moved into the root of _attachOverlay in order to capture it even when there are no options. This is problematic, because _attachOverlay is called as the user is typing which basically breaks the requireSelection feature.

These changes resolve the issue while preserving the original fix by only capturing the value when the overlay is actually attached.

Fixes #28113.

@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release labels Nov 14, 2023
…ns are filtered

In angular#27781 the call to capture the input value was moved into the root of `_attachOverlay` in order to capture it even when there are no options. This is problematic, because `_attachOverlay` is called as the user is typing which basically breaks the `requireSelection` feature.

These changes resolve the issue while preserving the original fix by only capturing the value when the overlay is actually attached.

Fixes angular#28113.
@crisbeto crisbeto force-pushed the 28113/autocomplete-require-selection branch from 87bbae4 to d534ae0 Compare November 14, 2023 08:11
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Nov 14, 2023
@crisbeto crisbeto removed the request for review from andrewseguin November 14, 2023 11:55
@crisbeto crisbeto merged commit 13629b0 into angular:main Nov 14, 2023
crisbeto added a commit that referenced this pull request Nov 14, 2023
…ns are filtered (#28119)

In #27781 the call to capture the input value was moved into the root of `_attachOverlay` in order to capture it even when there are no options. This is problematic, because `_attachOverlay` is called as the user is typing which basically breaks the `requireSelection` feature.

These changes resolve the issue while preserving the original fix by only capturing the value when the overlay is actually attached.

Fixes #28113.

(cherry picked from commit 13629b0)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

autoComplete: requireSelection not clearing selection after chaning value
2 participants