custom-cards / decluttering-card

🧹 Declutter your lovelace configuration with the help of this card
MIT License
369 stars 30 forks source link

The card uses non-unique ids for CSS elements inside a card #55

Open ildar170975 opened 1 year ago

ildar170975 commented 1 year ago

Checklist:

Release with the issue: 0.6.3

Last working release (if known):

Browser and Operating System: Chrome, Win10x64

Description of problem: The card uses a declutter-child value as an ID for css elements. Here is an example for custom:mini-graph-card: image

As a result - css elements do not have unique IDs in case of presence of several cards on the view. This becomes a problem when using a card-mod in Safari - using pointers like rect#some_id affects on all similar cards on the view instead of only one particular card. See a more detailed description: https://github.com/kalkih/mini-graph-card/issues/839

Javascript errors shown in the web inspector (if applicable): None

Additional information:

jlsjonas commented 1 year ago

decluttering-card actually seems to be overriding the card's id (which is supposed to be unique across the window) here https://github.com/custom-cards/decluttering-card/blob/master/src/decluttering-card.ts#L128 Causing the unintented side-effects down the line