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

ConfirmDialog: onHide prop is triggered immediately #7494

Closed
itismohammadreza opened this issue Dec 11, 2024 · 1 comment · Fixed by #7495
Closed

ConfirmDialog: onHide prop is triggered immediately #7494

itismohammadreza opened this issue Dec 11, 2024 · 1 comment · Fixed by #7495
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@itismohammadreza
Copy link

Describe the bug

The onHide prop in the ConfirmDialog is being invoked immediately upon rendering, rather than being called only when the dialog is supposed to hide

Reproducer

https://stackblitz.com/edit/epobfmq8?file=src%2FApp.jsx

System Information

Binaries:
    Node: 20.12.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.1.3 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Edge: Chromium (131.0.2903.63)
  npmPackages:
    primereact: ^10.8.3 => 10.8.3 
    react: ^18.2.0 => 18.2.0 
    tailwindcss: ^3.4.4 => 3.4.4

Steps to reproduce the behavior

1- Render the ConfirmDialog with an onHide prop provided as a callback.
2- Observe that the onHide callback is executed as soon as the component renders.

Expected behavior

The onHide callback should only be triggered when the dialog is explicitly hidden, such as when the user clicks accept or reject button

@itismohammadreza itismohammadreza added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 11, 2024
@itismohammadreza itismohammadreza changed the title ConfirmDialog: onHide Prop is Triggered Immediately ConfirmDialog: onHide prop is triggered immediately Dec 11, 2024
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 11, 2024
@melloware melloware self-assigned this Dec 11, 2024
@melloware melloware added this to the 10.8.6 milestone Dec 11, 2024
melloware added a commit to melloware/primereact that referenced this issue Dec 11, 2024
@melloware
Copy link
Member

PR submitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants