hig icon indicating copy to clipboard operation
hig copied to clipboard

side-nav - onMinimize and onClickCollapseButton events not triggered properly

Open nonoesp opened this issue 7 years ago • 1 comments

Unless I'm doing something wrong, it seems like the onMinimize and onClickCollapseButton event handlers (both from SideNav and SideNav.Module) are being triggered when the component is mounted instead of when the event is actually triggered.

You can see this behavior on the following sandbox, the console shows all the console.logs on mount and the alert as well. I thought the alert should be when the collapse button is clicked.

https://codesandbox.io/s/w74z7v5847

Thanks in advance!

Nono

nonoesp avatar Aug 24 '18 17:08 nonoesp

Hi @nonoesp ; in the sandbox you're setting the return of console.log and alert instead of providing event handlers. Here's a fork of that sandbox with functions being provided https://codesandbox.io/s/m4rrq8o8j.

Also, the SideNav.Module component also doesn't have an onMinimize prop. That's only available on the SideNav component. With that said, I do think we should provide a prop(s) to cover that use case.

Lastly, while looking at the SideNav.Module, I noticed that the controlled behavior is incorrect. That's something we should fix.

morrisallison avatar Aug 24 '18 21:08 morrisallison