iantrich / config-template-card

📝 Templatable Lovelace Configurations
MIT License
425 stars 55 forks source link

Cells should be selectable for Copy #103

Closed viktak closed 2 years ago

viktak commented 2 years ago

Is your feature request related to a problem? Please describe. The content of the cells are not selectable (by mouse).

Describe the solution you'd like When displaying tabular data, I would like to be able to select (a range of) cells with the mouse for quick copy/paste.

Describe alternatives you've considered

Additional context

ildar170975 commented 2 years ago

What cells are you talking about? Are you sure that this issue is related to the config-template-card?

viktak commented 2 years ago

Yes, it is that card, please see my sample yaml:

  - type: 'custom:config-template-card'
    variables:
      - states['sensor.hostnames'].state
      - ''' Network Hosts as of '''
      - states['sensor.hostnames'].attributes.lastUpdated
    entities:
      - sensor.hostnames
    card:
      type: custom:list-card
      entity: sensor.hostnames
      title: '${ vars[0] + vars[1] + vars[2] }'
      feed_attribute: hosts
      columns:
        - title: Hostname
          field: field4
        - title: IP Address
          field: field3
          style:
            - text-align: center
        - title: MAC Address
          field: field2
          style:
            - text-align: center

This example renders a table of hosts on my network along with some properties, like IP4 address, etc. What I would like to do is to be able to select and copy this table (or parts of it), like I can on any "average" web page: grid In this small example I would like to be able to select and copy any of the text, e.g. the IP address of a particular host.

ildar170975 commented 2 years ago

Did you write the code by yourself or copy/pasted it from somewhere? The table is created by the custom:list-card - your issue should be addressed to that card.

viktak commented 2 years ago

Oh, sorry, my mistake, it is the list-card.

Of course I wrote it, just wasn't thinking...