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

Panelmenu: Problem with Callbacks "onShow" and "onHide" #6789

Closed
rebula001 opened this issue Jun 24, 2024 · 4 comments · Fixed by #6850, leoo1992/GeradorQRCode#80 or leoo1992/GeradorQRCode#85 · May be fixed by mtech-31-quemistry/quemistry_client_web#20
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component. Typescript Issue or pull request is *only* related to TypeScript definition
Milestone

Comments

@rebula001
Copy link

rebula001 commented Jun 24, 2024

Describe the bug

The defaultProps defined in panelmenu.js: {onOpen: null, onClose: null} do not match the interface PanelMenuProps defined in panelmenu.d.ts: {onShow?(event: PanelMenuHeaderItemClickEvent): void; onHide?(event: PanelMenuHeaderItemClickEvent): void;}, causing errors and rendering these callback functions unusable.

The two functions "onOpen" and "onClose" also work only in the main menu, but not in the submenu.

Reproducer

https://stackblitz.com/edit/vitejs-vite-nbpegz?file=src%2FApp.tsx

PrimeReact version

10.6.6

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@rebula001 rebula001 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 24, 2024
@melloware melloware added Status: Needs Reproducer Issue needs a runnable reproducer and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 24, 2024
Copy link

Please fork the Stackblitz project and create a case demonstrating your bug report. This issue will be closed if no activities in 20 days.

@rebula001
Copy link
Author

rebula001 commented Jul 8, 2024

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Reproducer Issue needs a runnable reproducer labels Jul 8, 2024
@melloware
Copy link
Member

You are right the TypeScript is wrong and docs are wrong its onOpen and onClose not onShow and onHide

melloware added a commit to melloware/primereact that referenced this issue Jul 8, 2024
@melloware melloware added the Typescript Issue or pull request is *only* related to TypeScript definition label Jul 8, 2024
@melloware melloware added this to the 10.7.1 milestone Jul 8, 2024
@melloware melloware self-assigned this Jul 8, 2024
@rebula001
Copy link
Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment