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

HashNavigation replaceState does not work without Virtual since 9.2.4 #6703

Closed
6 tasks done
jur-ng opened this issue May 24, 2023 · 0 comments · Fixed by #6704
Closed
6 tasks done

HashNavigation replaceState does not work without Virtual since 9.2.4 #6703

jur-ng opened this issue May 24, 2023 · 0 comments · Fixed by #6704

Comments

@jur-ng
Copy link
Contributor

jur-ng commented May 24, 2023

Check that this is really a bug

  • I confirm

Reproduction link

sorrry

Bug description

Using replaceState in > 9.2.4 only updates the URL to #

Expected Behavior

It should update the url as expected

Actual Behavior

In 9.2.4 the following MR was merged: 3eb0ae2 . It adds support for using HashNavigation with Virtual, but accidentally breaks the regular usage. The problem comes from the fact that data-swiper-slide-index is used to find the active slide element, but it does not exist when virtual is not used. If virtual is not used it should just get the element using swiper.slides[swiper.activeIndex].

Swiper version

9.2.4+

Platform/Target and Browser Versions

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant