primereact icon indicating copy to clipboard operation
primereact copied to clipboard

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

Open rebula001 opened this issue 1 year ago • 1 comments

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

No response

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 avatar Jun 24 '24 08:06 rebula001

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

github-actions[bot] avatar Jun 24 '24 11:06 github-actions[bot]

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

rebula001 avatar Jul 08 '24 13:07 rebula001

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

melloware avatar Jul 08 '24 14:07 melloware

Thank you

rebula001 avatar Jul 10 '24 09:07 rebula001