amaximus / garbage-collection-card

Custom Lovelace card for Garbage Collection custom component
MIT License
127 stars 24 forks source link

[BUG] Have to click card twice to get it to disappear #88

Open SK360 opened 2 years ago

SK360 commented 2 years ago

Describe the bug As of recent updates when I click the card to hide it, it pops right back in. When I click it again it hides like normal

To Reproduce Steps to reproduce the behavior:

  1. Click card

Expected behavior Card hides on first click

Card config type: vertical-stack cards:

Environment (please complete the following information):

Additional context This only started with a recent update to either HA or the Garbage collection integration

amaximus commented 2 years ago

I could not reproduce it in a web browser (Chrome). I could, however, reproduce it with the Android HomeAssitant App, but after I turned on debugging for this component and had to restart HA, I could not reproduce it any more.

I'll run some tests again and will get back to you.

genehand commented 2 years ago

I'm also using the fully kiosk browser on an android tablet. When I click it, it disappears briefly, comes back for a few seconds, then disappears again. What happens if you click it once and wait?

amaximus commented 2 years ago

Most probably the fully kiosk browser has a not fully compatible implementation of the onClick event or the addEventListener method. At click - through the added onClick listener - the card simply sets the display style of the card to none.