Compare commits

...

3 Commits

Author SHA1 Message Date
Benjamin Paul [MSFT] 54f95aa7e6
Merge f6910346ca into 2562b84360 2024-02-04 18:34:19 +01:00
semantic-release-bot 2562b84360 chore(release): 4.1.2 [skip ci]
### [4.1.2](https://github.com/custom-cards/button-card/compare/v4.1.1...v4.1.2) (2024-02-01)

### Bug Fixes

* card would sometimes not be clickable ([56c3f44](56c3f44066)), closes [#738](https://github.com/custom-cards/button-card/issues/738) [#759](https://github.com/custom-cards/button-card/issues/759)
* support for new ha-state-icon in 2024.02 ([ab2b393](ab2b3939bc))
2024-02-01 11:21:38 +00:00
Benjamin Paul f6910346ca Don't trigger action on touchcancel event
When using the Android Navigation Back Gesture (swipe from side of
screen), tap actions are still triggered even though Android sent a
touchcancel event.

This changes makes it so that a touchcancel event does not trigger
actions.
2023-12-09 21:37:28 +00:00
3 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,11 @@
### [4.1.2](https://github.com/custom-cards/button-card/compare/v4.1.1...v4.1.2) (2024-02-01)
### Bug Fixes
* card would sometimes not be clickable ([56c3f44](https://github.com/custom-cards/button-card/commit/56c3f44066c6bd08fb8a7d8bb8fa679920dc5992)), closes [#738](https://github.com/custom-cards/button-card/issues/738) [#759](https://github.com/custom-cards/button-card/issues/759)
* support for new ha-state-icon in 2024.02 ([ab2b393](https://github.com/custom-cards/button-card/commit/ab2b3939bcce504125853d2ca9312d32f9a3f6d6))
### [4.1.2-dev.2](https://github.com/custom-cards/button-card/compare/v4.1.2-dev.1...v4.1.2-dev.2) (2024-02-01)

View File

@ -1,6 +1,6 @@
{
"name": "button-card",
"version": "4.1.2-dev.2",
"version": "4.1.2",
"description": "Button card for lovelace",
"main": "dist/button-card.js",
"scripts": {

View File

@ -179,6 +179,12 @@ class ActionHandler extends HTMLElement implements ActionHandler {
}
return;
}
// Don't do anything else if touch event was cancelled
if (ev.type == 'touchcancel') {
return;
}
const target = ev.target as HTMLElement;
// Prevent mouse event if touch event
if (ev.cancelable) {