Nemuritor01 / css-swipe-card

9 stars 1 forks source link

Swipe container height disables pagination #6

Open jack3308 opened 14 hours ago

jack3308 commented 14 hours ago

So using the card in a dashboard to swipe vertically.

It seems that explicitly setting the height option disables the actual pagination of the cards themselves. It doesn't seem to be an issue with the card hiding subsequent cards either, as the navigation_next icon is totally missing.

This is my code:

type: custom:css-swipe-card
cardId: testing
template: slider-vertical
height: 700px
navigation: true
navigation_next: mdi:information-variant
navigation_prev: mdi:gesture-tap
card_gap: 200px
custom_css:
  '--slides-align-items': center
  '--navigation-button-next-color': var(--accent-color)
  '--navigation-button-next-background-color': transparent
  '--navigation-button-next-width': 50px
  '--navigation-button-next-height': 50px
  '--navigation-button-prev-color': var(--accent-color)
  '--navigation-button-prev-background-color': transparent
  '--navigation-button-prev-width': 50px
  '--navigation-button-prev-height': 50px
cards:
  - type: custom:decluttering-card
    template: control
  - type: custom:mod-card
    card:
      type: custom:decluttering-card
      template: info
    card_mod:
      style: |
        ha-card { height: 400px; }

and here is the output: image

switching out height: 700px for auto_height: true provides this result: image

Nemuritor01 commented 5 hours ago

Hi and thanks for your feedback. Tough I do not fully understand the issue. Lets start with the 2nd pic. It seems auto:height detects a way taller card, as you expect to see. Sometimes, that because of a "false" or special code to reduce the visible area of a sub-card. Auto_height checks the hight of all sub_cards and uses the height of the tallest card, to set it to the container and its card-elements.

The navigation buttons in first picture seems strange. Tough, I need to check in more detail. I do not see this problem on my end. Also note, that I´ve chenged the code for auto_height and manual height in the new update. So lets see, if this is fixed with this version, as well. I will release the update soon.