You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to lets Swiper know that if any items are given to my swiper component that it should update itself and on any new item being pushed to it. Currently without calling update() manually it displays all items on full width underneath each other.
This is how I do it atm to have less layout shifts:
I set a min height on the swiper that is approximate the height an Swiper slide will have
I call the update inside an effect (same as ngOnInit) with an timeout (since rendering of Angular components takes a bit)
I created another effect that is re-called on any Signal change. Here it is called twice, since with timeout I had minor layout shifts and without it hasn't had the correct height later
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to lets Swiper know that if any items are given to my swiper component that it should update itself and on any new item being pushed to it. Currently without calling
update()
manually it displays all items on full width underneath each other.This is how I do it atm to have less layout shifts:
Beta Was this translation helpful? Give feedback.
All reactions