Skip to content
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

isEnd is falsely false on cubeEffect #7866

Closed
5 of 6 tasks
rbalet opened this issue Jan 26, 2025 · 6 comments
Closed
5 of 6 tasks

isEnd is falsely false on cubeEffect #7866

rbalet opened this issue Jan 26, 2025 · 6 comments
Labels
t0ggles Linked to the t0ggles task

Comments

@rbalet
Copy link

rbalet commented Jan 26, 2025

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/swiper-effect-cube-forked-g4vw9w

Bug description

  1. Grab the image
  2. Help the element to swipe till the end of it (Do not release the cursor before it has finished his animation).
  3. Release.
  4. The isEnd will still be false

Expected Behavior

Being true

Actual Behavior

Is false

Screen.Recording.2025-01-26.at.22.16.19.mov

Swiper version

v11.2.1

Platform/Target and Browser Versions

macOS Chrom v131.0.6778.265

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
@nolimits4web
Copy link
Owner

t0ggles-create swiper

Copy link

t0ggles bot commented Jan 27, 2025

Task nolimits4web/SWIPER-153 was created

t0ggles task SWIPER-153

@t0ggles t0ggles bot added the t0ggles Linked to the t0ggles task label Jan 27, 2025
@nolimits4web
Copy link
Owner

slideChange is not a proper event for that. use progress or reachEnd events for example.

Copy link

t0ggles bot commented Jan 27, 2025

Task nolimits4web/SWIPER-153 status changed to Done

@rbalet
Copy link
Author

rbalet commented Jan 27, 2025

Thx @nolimits4web I'll do

@rbalet
Copy link
Author

rbalet commented Jan 28, 2025

Hi @nolimits4web .

I've implement the reachEnd and it does work for my specific example.
But one of the problem is the following.

I'm using the slideChange to update the url (In case the user would reload, that we know which one to show.
And I do as follow

    this.swiper$()?.on('slideChange', (e) => {
      const actualFoo = this.fooQuery$.data()?.[e.realIndex - 1]

      if (actualFoo?.id) {
        this._location.replaceState('/foo/' + actualFoo.id)
      } else {
        if (e.isEnd) {
          this._location.replaceState('/foo')
        } else if (this.myMoodQuery$.data()?.id) {
          this._location.replaceState('/foo/me')
        } else {
          this._focusTitleInput()
          this._location.replaceState('/foo/new')
        }
      }
    })

   // End fix
    this.swiper$()?.on('reachEnd', (e) => {
      this._location.replaceState('/foo')
    })

The problem here, is that the bug does not only happen with the isEnd, but could also be reproducible over the realindex or activeInde.

What would be your proposal at that point ?

Here's an example of the impact of the code on the url
(Objective would be to go from /foo/actialFoo.id to /foo directly, without passing through /foo/new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t0ggles Linked to the t0ggles task
Projects
None yet
Development

No branches or pull requests

2 participants