Skip to content

bug(cdk/overlay): repeatedly opening and closing the overlay via (backdropClick) breaks responsiveness to clicks #30426

Closed
@JonasLuechau

Description

@JonasLuechau

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was 17.3.6

No response

Description

If you open and close a cdk overlay with backdrop repeatedly with (backdropClick), it will get stuck and not respond to button clicks anymore. The backdrop (and overlay) stays open in this case and is only closeable via the Esc button. This breaks our automated e2e tests and could reasonably happen to a user.

Reproduction

StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-tgvat6zz?file=src%2Fmain.ts
Steps to reproduce:

  1. Click pretty fast repeatedly on the open button
  2. After a few clicks the click on the backdrop will not cause the overlay to close. You can still close it with Esc though.

Expected Behavior

The backdrop and overlay should close if I click on the backdrop and have the (backdropClick) set up to close it.

Actual Behavior

After a few clicks the backdrop and overlay stays open and does not react to clicks anymore.

Environment

Angular CLI: 19.0.7
Node: 18.20.3
Package Manager: npm 10.2.3
OS: linux x64

Angular: 19.0.6
... animations, common, compiler, compiler-cli, core, forms
... platform-browser

Package Version

@angular-devkit/architect 0.1900.7
@angular-devkit/core 19.0.7
@angular-devkit/schematics 19.0.7
@angular/build 19.0.7
@angular/cdk 19.1.2
@angular/cli 19.0.7
@angular/material 19.1.2
@schematics/angular 19.0.7
rxjs 7.8.1
typescript 5.6.3
zone.js 0.15.0

Metadata

Metadata

Assignees

Labels

P2The issue is important to a large percentage of users, with a workaroundarea: cdk/overlay

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions