-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to disable image lazy loading listeners #7570
Comments
t0ggles-create swiper |
Task nolimits4web/SWIPER-138 was created |
I can confirm this patch for my use case as well. When having multiple instances of swiper on a page, will lead to blocking of the main thread, which is a major issue. This should be prioritized , if possible, as swiper is useless in list rendering scenario (50 instances in my case). |
Hm, after more testing Im not sure this fix alone helps with these performance issues. |
@PerpetualWar if you are using tailwind removing the classes from swiper component helps a lot. Its an undocumended behavior that swiper emits all the classes prefixed with swiper. |
@Xenossolitarius I do not use tailwind or having classes on swiper component. I have actually dealt with this by avoiding rendering those swipers if they are not visible in viewport. Works great for me , cause I have 3-4 swipers visible in the list at any given time, and perf increase is massive. |
@PerpetualWar made this, hope it gets approved |
Any examples with the issue? |
I should probably make a stackblitz but overall I am not interested into coupling my lazy loading logic which adheres to counting elements on the screen and registering them to actually pull images when business rules apply to the case. When i want to show 100 slides and 5 rows of swipers and virtual slides are out of option bcs i want to use slidesPerPage auto bcs of layout it just produces a 1 sec swiper recalculation lag |
Clear and concise description of the problem
I am running a multi row (swiper) image gallery which is actionable and I am lazy loading the images with my custom logic. Because I need the performance I didn't want to relay on the swiper but unfortunately it attaches listeners anyway. Which makes it 100% unusable for my usecase. Currently I am patching the swiper to stop that behavior.
Suggested solution
We can add if( preloadEnabled ) props around this behavior
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: