File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,6 @@ export interface ActionHandlerOptions {
25
25
disabled ?: boolean ;
26
26
repeat ?: number ;
27
27
repeatLimit ?: number ;
28
- isIcon ?: boolean ;
29
- cardHasHold ?: boolean ;
30
28
}
31
29
32
30
interface ActionHandlerElement extends HTMLElement {
@@ -141,12 +139,6 @@ class ActionHandlerType extends HTMLElement implements ActionHandlerType {
141
139
}
142
140
143
141
element . actionHandler . start = ( ev : Event ) => {
144
- if ( options . cardHasHold && ! options . hasHold ) {
145
- return ;
146
- }
147
- if ( options . isIcon ) {
148
- ev . stopPropagation ( ) ;
149
- }
150
142
this . cancelled = false ;
151
143
let x ;
152
144
let y ;
@@ -180,9 +172,6 @@ class ActionHandlerType extends HTMLElement implements ActionHandlerType {
180
172
} ;
181
173
182
174
element . actionHandler . end = ( ev : Event ) => {
183
- if ( options . isIcon ) {
184
- ev . stopPropagation ( ) ;
185
- }
186
175
// Don't respond when moved or scrolled while touch
187
176
if ( [ 'touchend' , 'touchcancel' ] . includes ( ev . type ) && this . cancelled ) {
188
177
if ( this . isRepeating && this . repeatTimeout ) {
Original file line number Diff line number Diff line change @@ -1225,6 +1225,12 @@ class ButtonCard extends LitElement {
1225
1225
const liveStream = this . _buildLiveStream ( entityPictureStyle ) ;
1226
1226
const shouldShowIcon = this . _config ! . show_icon && ( icon || state ) ;
1227
1227
1228
+ // Check if any icon actions are configured
1229
+ const hasIconActions =
1230
+ this . _config ! . icon_tap_action ! . action !== 'none' ||
1231
+ this . _config ! . icon_hold_action ! . action !== 'none' ||
1232
+ this . _config ! . icon_double_tap_action ! . action !== 'none' ;
1233
+
1228
1234
if ( shouldShowIcon || entityPicture ) {
1229
1235
let domain : string | undefined = undefined ;
1230
1236
if ( state ) {
@@ -1250,8 +1256,6 @@ class ButtonCard extends LitElement {
1250
1256
hasHold : this . _config ! . icon_hold_action ! . action !== 'none' ,
1251
1257
repeat : this . _config ! . icon_hold_action ! . repeat ,
1252
1258
repeatLimit : this . _config ! . icon_hold_action ! . repeat_limit ,
1253
- isIcon : true ,
1254
- cardHasHold : this . _config ! . hold_action ! . action !== 'none' ,
1255
1259
} ) }
1256
1260
> </ ha-state-icon >
1257
1261
`
You can’t perform that action at this time.
0 commit comments