Disabling drag and drop for png images

Hello, I’m trying to create a button card with png entity images, but I cannot disable the draggable feature for images.
I tried with custom button card attributes, card mod… has anyone ideas ?

thank you

type: custom:button-card
entity: select.sel_ctf
show_entity_picture: true
entity_picture: /local/images/comfort.png
name: Modo Soggiorno
tap_action:
  action: call-service
  service: select.select_option
  target:
    entity_id: select.sel_ctf
  data:
    option: |
      [[[
        if (states['select.sel_ctf'].state == 'off') return 'confort';
        if (states['select.sel_ctf'].state == 'confort') return 'economy';
        return 'off';
      ]]]
state:
  - value: "off"
    name: "Off"
    entity_picture: /local/images/leaf.png
    styles:
      card:
        - background-color: gray
      name:
        - color: white
  - value: confort
    name: Confort
    entity_picture: /local/images/leaf.png
    styles:
      card:
        - background-color: orange
      name:
        - color: white
  - value: economy
    name: Economy
    entity_picture: /local/images/leaf.png
    styles:
      card:
        - background-color: green
      name:
        - color: black
styles:
  card:
    - width: 200px
    - height: 200px
    - border-radius: 10px
  name:
    - font-size: 20px
  state:
    - font-size: 18px

Can you explain this a little better? What is a draggable feature for images?

yeah, when I tap on home assistant app or on safari the card the toggle works, but I can move the png all over the display and I don’t want this behavior :wink:

Is it all the images on the card or just the state images?

just the state image

Is this on a PC or a mobile device? I see the image drag with a different card type, but not with Button Card…

:laugh: nice, I tried with iPhone app, safari on iPhone and MacBook, but I will try shortly on a pc :slight_smile:

Just trying to rule out browser specific issues. Mushroom Card images on iPhone will drag but I don’t experience the same with Button Card images.

1 Like