Skip to content

Add stopPropagation to other state-cards #25599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

warmfire540
Copy link

Proposed change

Similar to all the other state-cards, we will not propagate the click events up. This can cause odd behavior in divs wrapping these controls which listen to click events. These makes all the state-cards act consistently.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

You would need a custom card to test that propagation is no longer happening.

- type: custom:device-card
  device_id: 75376456755137575411dd1b1c39567f
- type: custom:device-card
  device_id: 04cb8c479a6a122b15d8759e3927dd83

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @warmfire540

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant home-assistant bot marked this pull request as draft May 26, 2025 15:46
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@bramkragten
Copy link
Member

Can you share use case without using custom cards, or is this just for custom cards?

@warmfire540
Copy link
Author

@bramkragten at this time state-card-content is only used in a few places, none which wrap it an an anchor to demonstrate.

I can pinpoint other places where we stop propagation on the ha-select or ha-textfield. worse case this would make the behavior consistent for them all, since the other state-cards all handle the click event or their underlying control handles it.

@warmfire540
Copy link
Author

let me know if tests would suffice, i can create a few for each state-card component to validate this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants