docs-bug(cdk-overlay): Add missing detach handler in overlay example #30185
Labels
area: cdk/overlay
docs
This issue is related to documentation
P4
A relatively minor issue that is not relevant to core functions
Documentation Feedback
The CDK Overlay example is missing a crucial event handler. Specifically, when using the
ESC
key to close the overlay, the parent component's state isn't properly updated, leading to inconsistent behavior:Current behavior (demonstrated in the StackBlitz):
The solution is to add the detach handler (demonstrated in the StackBlitz):
Here is a StackBlitz link that demonstrates both the issue and the working solution with the detach handler. I'm ready to submit a PR implementing these changes once this approach is confirmed.
Affected documentation page
https://material.angular.io/cdk/overlay/overview
The text was updated successfully, but these errors were encountered: