Skip to content
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

bug(cdk-experimental:DIALOG): Config option disableClose does not work with openFromTemplate #18964

Closed
PierreDuc opened this issue Apr 1, 2020 · 2 comments · Fixed by #18968, lingounet/testage#29 or michael-vasyliv/ngx-virtual-swiper#24
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@PierreDuc
Copy link

Reproduction

While using the dialog to open a template by calling openFromTemplate, the disableClose is not respected. When you use a component by calling openFromComponent, the disableClose does work.

Most likely cause:

Inside _attachDialogContentForComponent there is a

dialogRef.disableClose = config.disableClose;

This is missing in the _attachDialogContentForTemplate

Expected Behavior

That the dialog doesn't close on Escape key if disableClose is true

Actual Behavior

It closes when it shouldn't :(

Environment

  • Angular: 9.1.0
  • CDK-experimental: 9.2.0
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@PierreDuc PierreDuc added the needs triage This issue needs to be triaged by the team label Apr 1, 2020
@crisbeto crisbeto self-assigned this Apr 1, 2020
@crisbeto crisbeto added has pr P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs triage This issue needs to be triaged by the team labels Apr 1, 2020
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 1, 2020
…logs

Fixes the `disableClose` option not working for template-based dialogs, because we have two separate places where the config was being synced up with the dialog ref and one of them wasn't updated. These changes move the creation logic to a single place.

Fixes angular#18964.
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 1, 2020
…ialogs

Fixes the `disableClose` option not working for template-based dialogs, because we have two separate places where the config was being synced up with the dialog ref and one of them wasn't updated. These changes move the creation logic to a single place.

Fixes angular#18964.
@PierreDuc
Copy link
Author

@crisbeto Nice fix, I like it :)

mmalerba pushed a commit that referenced this issue Apr 6, 2020
Fixes the `disableClose` option not working for template-based dialogs, because we have two separate places where the config was being synced up with the dialog ref and one of them wasn't updated. These changes move the creation logic to a single place.

Fixes #18964.
mmalerba pushed a commit that referenced this issue Apr 14, 2020
Fixes the `disableClose` option not working for template-based dialogs, because we have two separate places where the config was being synced up with the dialog ref and one of them wasn't updated. These changes move the creation logic to a single place.

Fixes #18964.
@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 May 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
2 participants