fix(aria/combobox): closing immediately when opening programmatically with zone.js#33518
Merged
Merged
Conversation
… with zone.js The combobox was using an effect to decide whether to close the overlay, however this was brittle because it relied on the effect scheduler to run once all bindings have been evaluated. This was breaking down with Zone.js which seemed to fire the effect for each signal change individually. These changes resolve the issue by moving the logic into the `focusout` handler which gives us a better indication about where the event is coming from. Fixes angular#33516.
crisbeto
commented
Jul 10, 2026
| onFocusout(event: FocusEvent) { | ||
| onFocusout() { | ||
| // Give focus some time to move before we check it. | ||
| setTimeout(() => { |
Member
Author
There was a problem hiding this comment.
I'm not a big fan of the timeout, but I don't know if there's a better way to give it some time for focus to move into the popup.
Member
There was a problem hiding this comment.
Yea it's probably just necessary...
ok7sai
approved these changes
Jul 10, 2026
Member
Author
crisbeto
added a commit
that referenced
this pull request
Jul 10, 2026
… with zone.js (#33518) The combobox was using an effect to decide whether to close the overlay, however this was brittle because it relied on the effect scheduler to run once all bindings have been evaluated. This was breaking down with Zone.js which seemed to fire the effect for each signal change individually. These changes resolve the issue by moving the logic into the `focusout` handler which gives us a better indication about where the event is coming from. Fixes #33516. (cherry picked from commit def7bc2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The combobox was using an effect to decide whether to close the overlay, however this was brittle because it relied on the effect scheduler to run once all bindings have been evaluated. This was breaking down with Zone.js which seemed to fire the effect for each signal change individually.
These changes resolve the issue by moving the logic into the
focusouthandler which gives us a better indication about where the event is coming from.Fixes #33516.