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

DynamicDialog onClose not called #7225

Open
4 tasks
datbth opened this issue Feb 8, 2025 · 2 comments
Open
4 tasks

DynamicDialog onClose not called #7225

datbth opened this issue Feb 8, 2025 · 2 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@datbth
Copy link

datbth commented Feb 8, 2025

Describe the bug

After using dialogRef.value.close() once, closing the Dynamic Dialog using header close button or escape key no longer triggers the onClose() callback.

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-aelagy3a?file=src%2FMyDialog.vue

Environment

as in stackblitz

Vue version

3.4.31

PrimeVue version

4.2.5

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  1. Click Button to open dialog
  2. Click close icon in dialog header -> new console log showing that onClose() is called
  3. Click Button to open dialog again
  4. Click Close button in the dialog -> new console log showing that onClose() is called
  5. Click Button to open dialog again
  6. Click close icon in dialog header -> no new console log showing that onClose() is *not called

Expected behavior

Step 6: Click Close button in the dialog -> new console log showing that onClose() is called

@datbth datbth added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 8, 2025
@datbth
Copy link
Author

datbth commented Feb 8, 2025

I notice that

  • This does not happen with primevue 4.0.0.rc3 (default version of the stackblitz template)
  • In step 6, onDialogHide does not call onClose because this.currentInstance is present
    • Looks like this is because onDialogAfterHide is never called

@kerimcharfi
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants