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

Unable to modify freeMode.enabled after initialization #7751

Open
5 of 6 tasks
seinsationalist opened this issue Sep 26, 2024 · 0 comments
Open
5 of 6 tasks

Unable to modify freeMode.enabled after initialization #7751

seinsationalist opened this issue Sep 26, 2024 · 0 comments

Comments

@seinsationalist
Copy link

seinsationalist commented Sep 26, 2024

Check that this is really a bug

  • I confirm

Reproduction link

https://codepen.io/quill-quarius/pen/ExqjKrP?editors=1111

Bug description

There seem to be no methods allowing one to change the "enabled" property of freeMode after initialization.

let swiper = new Swiper('.swiper', { freeMode: { enabled: true, } });

console.log(swiper.freeMode.enabled) returns undefined

I can't imagine that this is intended as I'm able to modify the exact same enabled property for mousewheel with
swiper.mousewheel.enabled = false or using the method swiper.mousewheel.disable().

I found a workaround which is to simply remove the document.querySelector('.swiper-wrapper').classList.remove('swiper-free-mode') which seems to disable freeMode.

If this is not intended please make properties accessible and add methods. Thank you

Expected Behavior

No response

Actual Behavior

No response

Swiper version

v11.1.14 (CDN)

Platform/Target and Browser Versions

Windows, Brave (Chromium)

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

No branches or pull requests

1 participant