button-card
button-card copied to clipboard
Add stop_propagation config option to stop click or touch events propagation
Useful when using button-card inside another card. Making it a config option instead of always applying it because of this comment.
For an example application, when using a button-card, inside the title-card of lovelace-expander-card with title-card-clickable. In this case, when clicking a button-card with a tap action, letting the click/touch event bubble up would also unintentionally expand/collapse the expander card.
@Zhephyr54 Isn't it a bug in the expander-card? Any card with an action in the title card can trigger an expander... Probably the author of expander doesn't take into account the possibility that someone will use an action other than collapse/expand.
For example, I used the default tile-card for the title card. The result is the same, so this is more a problem of what handler function the expander uses
@ngocjohn Not sure if this can be done in my specific use case: I am using a stack-in-card as a title card, this stack contains several button cards, some without action handlers that should propagate and others with action handlers that should stop propagation. How would you deal with this?
I don't believe this is still relevant.