amaximus / garbage-collection-card

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

[BUG] hide_on_click not working in Firefox (Edit: and iOS app) #68

Closed WongGendheng closed 3 years ago

WongGendheng commented 3 years ago

Describe the bug I updated to the newest version of garbage-collection-card today and was excited about the new feature "hide_on_click". However, it does not appear to be working on Firefox. When I click the icon, the icon disappears for about 0.5 seconds, then reappears soon after. Sometimes it disappears for like a second, but it always reappears. I run supervisor 2020.12.7 on Home Assistant OS 5.9 and Firefox 84.0.1 (64 Bit). Restarting HA did not solve the issue.

To Reproduce I simply updated to the newest version of garbage-collection-card and Garbage Collection sensor. I tried either adding the hide_on_click or not (since it days true by default).

Expected behavior

Screenshots

Environment (please complete the following information):

Additional context It appears to be working on Microsoft Edge. Disabling Adblocker Ultimate, I dont care about cookies and Ghostery did not solve the issue.

Do you have any ideas on how to get it to work in Firefox? Any help is appreciated. Thanks for the great work.

WongGendheng commented 3 years ago

Edit: it does not appear to work on iOS app either (iPhone 8, iOS 14.4)

Matchlighter commented 3 years ago

The culprit appears to be https://github.com/amaximus/garbage-collection-card/blob/64a82b8dac2624c6e4aa6ca0c731d585a49683d2/dist/garbage-collection-card.js#L163 Firefox does not like the use of .s (at least not in en_US in my case) instead of -s in the date string (Chrome is okay with .s, though it arguably shouldn't be, JS specification and what not). The .replace(...) logic should be removable outright and still parse right in any locale as the browser should see it as ISO8601 format.

amaximus commented 3 years ago

Thanks for reporting it and pinpointing the root cause.

I'll issue a fix for it tomorrow. It's fixed locally but I wnat to do some more tests.

amaximus commented 3 years ago

The issue has been fixed in the latest release.

Please update the card and get back to me with results.

WongGendheng commented 3 years ago

Works like a charm on both iOS and in Firefox. Thank you very much for the incredibly fast fix.