button-card icon indicating copy to clipboard operation
button-card copied to clipboard

Add stop_propagation config option to stop click or touch events propagation

Open Zhephyr54 opened this issue 10 months ago • 2 comments

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 avatar Jan 23 '25 21:01 Zhephyr54

@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 avatar Jan 23 '25 23:01 ngocjohn

@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?

Zhephyr54 avatar Jan 27 '25 07:01 Zhephyr54

I don't believe this is still relevant.

RomRider avatar Sep 16 '25 12:09 RomRider