nolimits4web / swiper

Most modern mobile touch slider with hardware accelerated transitions
https://swiperjs.com
MIT License
39.56k stars 9.75k forks source link

swiper.virtual.removeSlide has a bug #7020

Closed xiayejinchen closed 12 months ago

xiayejinchen commented 1 year ago

Check that this is really a bug

Reproduction link

https://github.com/nolimits4web/swiper.git

Bug description

When using swiper.virtual.removeSlide to delete a cached virtual slide, for example, if 4 slides have been cached and slide 2 is deleted, two slides 3 will appear.

Because virtual.cache is an object, just delete key of virtual.cache,for example 2,virtual.cache will be equal to {1:'slide 1', 3: 'slide 3', 4: 'slide 4'}. And After swiper.virtual.update, virtual.cache will be equal to {1:'slide 1', 2:'slide 3', 3: 'slide 3', 4: 'slide 4'}

Expected Behavior

No response

Actual Behavior

No response

Swiper version

8b7386450e006f2b335b0f8e272f59f3d40a8d9f

Platform/Target and Browser Versions

chrome

Validations

Would you like to open a PR for this bug?

github-actions[bot] commented 1 year ago

Hello @xiayejinchen. Please provide a online reproduction by codesandbox or a minimal GitHub repository. You can fork one of our demos in codesandbox to get start. Issues labeled by missing demo will be closed if no activities in 3 days.

xiayejinchen commented 1 year ago

you can see the demo in https://github.com/xiayejinchen/test.git

nolimits4web commented 1 year ago

Why not create CodeSandbox?

Kind regards, Vladimir Kharlampidi


From: xiaobai @.> Sent: Friday, September 8, 2023 12:55:41 PM To: nolimits4web/swiper @.> Cc: Subscribed @.***> Subject: Re: [nolimits4web/swiper] swiper.virtual.removeSlide has a bug (Issue #7020)

you can see the demo in https://github.com/xiayejinchen/test.git

— Reply to this email directly, view it on GitHubhttps://github.com/nolimits4web/swiper/issues/7020#issuecomment-1711400345, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAHUBJHZHMBLJ4O4MSRHH43XZLTR3ANCNFSM6AAAAAA4PEXWC4. You are receiving this because you are subscribed to this thread.Message ID: @.***>

xiayejinchen commented 1 year ago

You can see the demo at https://6lxtmm.csb.app/

After you see the 'slide 4', then delete 'slide 3', you will see two 'slide 4'