Lovelace: Button card

No it doesn’t do it on my wifes iphone. I just tried it. It never does it, I have tried everything. So it seems like it really is ios 13 only

You shouldn’t have removed your post, it’s broken. It doesn’t work anymore with swipe-card or cch… I’ll need to revert some things.

1 Like

I’m sure that it’s will be perfect again :slight_smile:

So because of that bug, I almost ended up with my garage door closing on my car on the week end. I have a lock on the door switch but it did a double tap. I thought it was operator error. No harm done luckily. Thanks for the fix.

I did more testing now. I spun up a simulated iOS device with xcode and I was completely unable to reproduce this bug while at the same time having it still on my device. I am using the beta xcode and iOS13 and the same device type.

Then to test my memory of not having this issue I renamed the js file and edited my resource path to the new file which was the old 1.11.1. I do not have the new issue on either the simulated device nor my device but the original issue has returned.

I then renamed the resource path back to the new one and the original issue is fixed but now I have the new issue again. This doesn’t really help the fact that you cannot reproduce it though.

Trying to build the old version from github and I get an error:

src\button-card.ts
Error: C:/Users/shanefaulkner/Desktop/button-card2/src/button-card.ts(547,9): semantic error TS2542 Index signature in type 'StyleInfo' only permits reading.

Any ideas why the old versions won’t compile now in babel?

Ok, so I have reverted to 1.11.1 and the conditional card glitch is gone (it would double tap quickly after turning on/off a button that would at the same time change the card behind it as it is conditional). I use a lot of conditional cards as they are more versatile than popup cards imo as they are just on a single view and thus scrollable.

Now the button glitch is back in this version, but the bug with conditional cards seem to work.

In your newest release the buttons work great but the conditional cards don’t.

Here is a video with 1.11.1, as you will see the light buttons will do a double tap, but the conditional cards work perfectly fine.

Here is 2.0.4, the buttons work fine here but the conditional cards wont. When pressing a button which changes the card it will press it again, in my case either opening the weather panel or the person panel.

Awesome look! I might try this

I was able to take this line in version 1.11.1: https://github.com/custom-cards/button-card/blob/efcaf7a7797465728edbd747391adb40651bb66c/dist/button-card.js#L880

And remove ‘, t.addEventListener(“mousedown”, e, { passive: !0 }), t.addEventListener(“click”, n)’ from the end leaving the semi-colon. This fixes both issues with the inability to use it on the desktop.

I cannot get the old version to build so I cannot add the if statements easily for discarding them only when iOS.

I also confirmed that the issue starts with 2.0.0

Dear, I found a problem
Don’t know if anybody else is facing,
I have an entity as button card which on hold_action was working well.
But after upgrading button-card few days back, it was toggling on single tap.

It’s not clear what your actual problem is. You refer to a hold action working well but then start talking about toggling with a tap…what’s the actual problem?

Dear
Hold_action was not working on holding the button.
It was toggling even on single tap.
I had to add tap_action: none before hold_action to get it working.

Toggle is by default for tap, unless you define tap_action’s action as none. That’s not new at all.

Okay, thanks for all the testing, appreciate it!
This bug was probably introduced by those 2 lines which where added to fix another bug:

Would you mind deleting them from 2.0.4 and test the result on your device please?

I actually tried that already and didn’t have any luck. It is also in the button-card.ts so I just tried removing it there also and I still have it happen unfortunately.

That is really strange… It’s the only thing which was changed regarding touch/mouse events…

Also for this to work, you’d have had to remove the node_module folder and run npm install :wink:

Could you try that file please? https://www.pastiebin.com/5d3fec8d63daf

EDIT: I’ve managed to reproduce the “second clic on the target tab” when moving from one tab to another tab on my phone (android) and it’s fixed with the above version for me.

1 Like

I think this fixed it!

It looks like the button card doesn’t like the swiping. I can swipe the views on the “empty” area (button card color type: blank) only my Lovelace dashboard:

Thanks, that’s going to be fixed soon. I’ll release something tomorrow.
It’s all related to this and this

1 Like

I appreciate all the work with resolving this and the great card itself.