bramkragten / swipe-card

Card that allows you to swipe throught multiple cards for Home Assistant Lovelace
245 stars 36 forks source link

swiper does not update size #32

Closed matt8707 closed 1 year ago

matt8707 commented 3 years ago

I'm using custom:layout-card and the swiper container does not update its size unless I resize the window (ResizeObserver). The same behaviour can be observed in edit ui, but not when not in edit mode. I have attached a video of what it looks like.

Is it possible to update swiper more often or should I take this issue to layout card?

Thanks!

https://user-images.githubusercontent.com/36163594/120053759-56a9e180-c02c-11eb-9535-9ac401a162b8.mp4

jrbloemhof commented 3 years ago

Updating only on window resize is how the underlying Swiper library works by default, but you can try using the breakpointsBase parameter to switch it to resize with the container. Note that the documentation calls it a "beta" feature, so it may not work.

matt8707 commented 3 years ago

That sadly seems to have no effect, dependency 6.5.9

parameters:
  breakpointsBase: container

I've fixed most issues with css, the only remaining is opening/closing the sidebar on desktop