Skip to content

fix(material/autocomplete): blocking events to other overlays when there are no results #27432

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

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

crisbeto
Copy link
Member

The autocomplete trigger attaches an overlay even if there are no options in the list. It also subscribes to keydown events and clicks while the panel is open which block events from reaching other overlays. This means that if the user focuses an autocomplete input with no options, the events from it won't reach other overlays.

These changes resolve the issue by subcribing and unsubscribing from the event streams depending on the visibility state of the panel.

Fixes #26479.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels Jul 11, 2023
@crisbeto crisbeto marked this pull request as ready for review July 11, 2023 10:37
…ere are no results

The autocomplete trigger attaches an overlay even if there are no options in the list. It also subscribes to keydown events and clicks while the panel is open which block events from reaching other overlays. This means that if the user focuses an autocomplete input with no options, the events from it won't reach other overlays.

These changes resolve the issue by subcribing and unsubscribing from the event streams depending on the visibility state of the panel.

Fixes angular#26479.
@crisbeto crisbeto force-pushed the 26479/autocomplete-event-handling branch from e373046 to 1d7e476 Compare July 11, 2023 11:54
@crisbeto crisbeto self-assigned this Jul 11, 2023
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Jul 11, 2023
@crisbeto crisbeto merged commit ff2a3cc into angular:main Jul 11, 2023
crisbeto added a commit that referenced this pull request Jul 11, 2023
…ere are no results (#27432)

The autocomplete trigger attaches an overlay even if there are no options in the list. It also subscribes to keydown events and clicks while the panel is open which block events from reaching other overlays. This means that if the user focuses an autocomplete input with no options, the events from it won't reach other overlays.

These changes resolve the issue by subcribing and unsubscribing from the event streams depending on the visibility state of the panel.

Fixes #26479.

(cherry picked from commit ff2a3cc)
stephenrca pushed a commit to stephenrca/components that referenced this pull request Aug 2, 2023
…ere are no results (angular#27432)

The autocomplete trigger attaches an overlay even if there are no options in the list. It also subscribes to keydown events and clicks while the panel is open which block events from reaching other overlays. This means that if the user focuses an autocomplete input with no options, the events from it won't reach other overlays.

These changes resolve the issue by subcribing and unsubscribing from the event streams depending on the visibility state of the panel.

Fixes angular#26479.
@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 Aug 11, 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 P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent 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): Escape key press not propagated even if panel is closed
2 participants