I have a button in a horizontal panel. Both the button and panel have click handler.
When I click the button, I only want the button click handler to work but not the panel one, but it triggers both.
How can I avoid triggering the panel click handler?
Just call
event.stopPropagation()in your click handler. See the answer here for an example.