primevue icon indicating copy to clipboard operation
primevue copied to clipboard

Dialog: Nested dialogs are closed together when they are closed with the ESC key

Open gaecfov opened this issue 1 year ago • 2 comments

Describe the bug

Nested dialogs are closed together when they are closed with the ESC key

Reproducer

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

PrimeVue version

4.0.5

Vue version

4.x

Language

ALL

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

gaecfov avatar Aug 26 '24 02:08 gaecfov

@gaecfov

On my side I have 2 dialogs (Dialog Parent and dialog Child).

On Dialog Parent I have: :closeOnEscape="canCloseOnEscape"

On Dialog Child I have: :closeOnEscape="true"

On the Parent Dialog, canCloseOnEscape is true by default.

Now, the moment I show my child dialog I set canCloseOnEscape (Parent Dialog) to false and the moment I close my child dialog I again set my canCloseOnEscape (Parent Dialog) to true.

1Map avatar Sep 01 '24 10:09 1Map

@cagataycivici @tugcekucukoglu

Steps to Reproduce:

  • Set :closeOnEscape="true" and :closable="false" in the dialog component.
  • The escape key no longer closes the dialog as expected. It seems like the closable prop might be conflicting with the closeOnEscape functionality.

Expected Behavior:

  • The dialog should close when the escape key is pressed, regardless of the closable setting if :closeOnEscape="true" is set.

It would be great if this issue could be looked into or let me know if I should create separate issue for that, Thank you!

SagarNaliyapara avatar Oct 11 '24 08:10 SagarNaliyapara

Also running into this issue.

peterloron avatar Jan 01 '25 04:01 peterloron

Same here. I also have another issue which might be related: when the child dialog closes, I instruct it to emit a custom signal with a value. The parent dialog never receives that signal. The signal is emitted upon the child's @hide signal.

suzumejakku avatar Jan 14 '25 19:01 suzumejakku

Related to this, the preview for the Image component also has this same issue. If an Image is inside a Dialog, when user presses esc inside the image preview, the dialog closes.

IsaacAbrahamson avatar Oct 07 '25 14:10 IsaacAbrahamson