Skip to content

fix(material/select): open handler invoked twice#33119

Closed
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:33116/select-double-clicks
Closed

fix(material/select): open handler invoked twice#33119
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:33116/select-double-clicks

Conversation

@crisbeto
Copy link
Copy Markdown
Member

Fixes that the select's open handler was being called twice: once from the trigger's click handler and once from the onContainerClick callback when the event propagates.

Fixes #33116.

@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Apr 22, 2026
@pullapprove pullapprove Bot requested review from andrewseguin and ok7sai April 22, 2026 07:41
@ok7sai
Copy link
Copy Markdown
Member

ok7sai commented Apr 22, 2026

I was looking at the issue and couldn't reproduce the issue with v21 https://stackblitz.com/edit/stackblitz-starters-u3gf9hh9?file=src%2Fmain.ts

@crisbeto
Copy link
Copy Markdown
Member Author

I could repro it with the code from #33116, but it actually only happens when you click on the trigger itself, not the mat-form-field around it.

Fixes that the select's `open` handler was being called twice: once from the trigger's `click` handler and once from the `onContainerClick` callback when the event propagates.

Fixes angular#33116.
@crisbeto crisbeto force-pushed the 33116/select-double-clicks branch from 18b2239 to bcf58e5 Compare April 22, 2026 10:09
@crisbeto
Copy link
Copy Markdown
Member Author

I tried a few different approaches here, but they were all really breaking internally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: material/select 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(select): mat-select.close() emits openedChange event with value "true"

2 participants