Panel: panelclose event does not work

Fixes gh-7058
Closes gh-7260