thomasloven / lovelace-state-switch

🔹Dynamically replace lovelace cards depending on occasion
MIT License
382 stars 27 forks source link

State content exceeding container width #70

Open amitkeret opened 2 years ago

amitkeret commented 2 years ago

I've found that in certain situations, the "stated" card exceeds its parent width. For me, it seems to happen as a result of images not being resized or restricted to the parents container's width, so if a larger image appears, it causes the entire card to "stretch" past its container. The images appear as part of the mini-media-player custom card.

No media playing:

Media playing, normal sized thumb:

Media playing, large thumb:

Media playing, large thumb, scrolling down to it:

I'm using hash-based state. I've looked at #14 and #18 and I think this is a separate issue. Using version 1.9.1 of state-switch.

(I've removed irrelevant things from the code below)

- type: vertical-stack
  cards:
    - type: grid
      cards:
        - type: button
          tap_action:
            action: navigate
            navigation_path: '#tv'
        - type: button
          tap_action:
            action: navigate
            navigation_path: '#kodi'
        - type: button
          tap_action:
            action: navigate
            navigation_path: '#ac'
- type: custom:state-switch
  entity: hash
  default: none
  states:
    tv:
      type: ..........
    kodi:
      type: vertical-stack
      cards:
        - ..........
        - type: conditional
          conditions:
            - entity: media_player.koditv
              state_not: idle
          card:
            type: custom:mini-media-player
            entity: media_player.koditv
            volume_stateless: false
            hide:
              power: true
              controls: true
              volume: true
              icon: true
            artwork: full-cover
            name: Now Playing
    ac:
      type: ..........
w1tw0lf commented 2 years ago

Sitting with the same issue.

Stijn-Daniels commented 2 years ago

I have the exact same issue since 1.9.0. Reverting to version 8 fixes the issue for now.

andrazek commented 2 years ago

I also have this issue. Is there a workaround?

LastElf commented 2 years ago

I'm getting the same thing with the upcoming media card on mobile with a hash state. Resizing a desktop browser handles the resize fine

thomasloven commented 2 years ago

Please try release 1.9.3.

Stijn-Daniels commented 2 years ago

@thomasloven seems to work so far, thanks for fixing it and thanks for all your plugins!