Are you asking about how to handle a click event on some panel that is bigger than the “PanelExpanderButton” that you have in that panel? It really would help if you described your circumstances and what you want more completely, preferably with a small screenshot. That might reduce the guessing that I have to do.
I suppose you could implement your own GraphObject.click event handler that either:
- called the click event handler of the “PanelExpanderButton”, or
- executed the same code as that “PanelExpanderButton” event handler, shown in https://gojs.net/latest/extensions/Buttons.js
OK, then my previous answer does apply to your situation.
OK, so now whenever the user clicks anywhere within the “Vertical” Panel, your click function will be called.
You may want to set click = null on the “PanelExpanderButton”, so that its click doesn’t happen and then bubble up to your handler, causing the panel visible property to be toggled twice.