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
We are currently using slidesPerView: 'auto' with predefined slide widths, which works perfectly for our UI requirements. This approach allows our layout to adapt seamlessly to varying screen sizes by automatically adjusting the number of visible slides based on their widths and the spacing between them.
However, we have more than 50 slides in our implementation, and to optimize performance, we would like to leverage the virtual slide rendering mode to dynamically load slides. Unfortunately, we’ve found that slidesPerView: 'auto' is not currently compatible with the virtual mode, as virtual rendering requires an exact number for slidesPerView. This limitation conflicts with our design, where slide widths and spacing may vary depending on the screen size.
Suggested solution
Simply allow specifying a fixed slide width using a slideWidth: number parameter. The number of visible slides could then be calculated by dividing the Swiper width by the specified slideWidth plus the gap. This enhancement would enable the combination of the slidesPerView: 'auto' option with the virtual: true rendering mode.
Clear and concise description of the problem
We are currently using
slidesPerView: 'auto'
with predefined slide widths, which works perfectly for our UI requirements. This approach allows our layout to adapt seamlessly to varying screen sizes by automatically adjusting the number of visible slides based on their widths and the spacing between them.However, we have more than 50 slides in our implementation, and to optimize performance, we would like to leverage the virtual slide rendering mode to dynamically load slides. Unfortunately, we’ve found that
slidesPerView: 'auto'
is not currently compatible with the virtual mode, as virtual rendering requires an exact number forslidesPerView
. This limitation conflicts with our design, where slide widths and spacing may vary depending on the screen size.Suggested solution
Simply allow specifying a fixed slide width using a
slideWidth: number
parameter. The number of visible slides could then be calculated by dividing the Swiper width by the specifiedslideWidth
plus the gap. This enhancement would enable the combination of theslidesPerView: 'auto'
option with the virtual: true rendering mode.Alternative
No response
Additional context
No response
Validations
Would you like to open a PR for this feature?
The text was updated successfully, but these errors were encountered: