SwiperJS Assistance
Hello, is anyone here familiar with SwiperJS?
I seem to be unable to find any way to update "freeMode" after initialization.
I'm able to do this for "mousewheel" with swiper.mousewheel.disable(). yet there seems to be no equivelant for freeMode.
Any ideas are appreciated
49 Replies
and where can we see this issue happening? any live examples?
It isn't so much of an issue as it is a lack of documentation. However, I managed to find a workaround by toggling a class
If you're familiar with swiperjs I'm happy to make a demo of what I'm trying to do, but essentially I'm just initializing it like this
and then attempting to update the "enabled" value. And I'm unable to find any official way of doing this besides my workaround. Which I find strange, since I'm able to do precisely this with "swiper.mousewheel.disable()"
🤔
If you know any better way of doing it definitely let me know
there's an enable method
MousewheelMethods | Swiper - v11.1.14
Documentation for Swiper - v11.1.14
Yep but that's with mousewheel, my bad, I didn't clarify, mousewheel is another option I'm using along with freeMode, that I don't have any issues with. I was just using it as an example of what I'd like to do with freeMode
I need exactly these methods but for freeMode
or an equivalent
you said "mousewheel" here, at the end
Yes, I was showing you an example of what I want to do with freeMode
I want to use the same methods that I can use on mousewheel, but on freeMode
But freeMode doesn't seem to have these methods, so I'm looking for an equivalent
yeah, the documentation seems to be broken
Yeah they're not very good unfortunately
I've had to do so many workarounds with swiperjs already
its a really good library besides the lack of documentation
https://github.com/nolimits4web/swiper/blob/master/src/types/modules/free-mode.d.ts <-- actually, it isnt broken
GitHub
swiper/src/types/modules/free-mode.d.ts at master · nolimits4web/sw...
Most modern mobile touch slider with hardware accelerated transitions - nolimits4web/swiper
the code seems wrong
you have the enabled property
can you try setting it directly?
Like with swiper.freeMode.enabled = false?
I've tried this, but "enabled" isn't part of freeMode when I try accessing it outside of the initialization
the types must be all busted then
I simply get these 3 methods
and what's in the prototype?
I'm not exactly sure what to make of these
just a normal object prototype
yeah, seems like a bug
maybe you should file an issue on github
just for comparison:
What if they didn't intend to allow the user to disable it for whatever reason?
then they don't
and you found a workaround
I suppose
thanks for your help regardless
just make an issue with this inconsistency
and dont talk about your workaround, so you have a working solution, for now
Haha I won't thanks
actually, lock your version and report the workaround too
so you can always have a working solution, and the workaround gets fixed
that works too
it's a better solution
https://github.com/nolimits4web/swiper/blob/master/src/modules/free-mode/free-mode.mjs <-- by the way, it seems there's no actual way to disable it
very strange
I can't imagine no one ever faced this issue before
i cant imagine it too
fwiw and doesn't answer your question, but I feel your frustration with SwiperJS 😅 works great when it works and not so much when it doesn't
Haha yeah I'm heavily considering just writing my own swiper at this point. This isn't my first battle with SwiperJS either, my current project is full of workarounds to counter SwiperJS' lack of customization/documentation
this isn't a lack of documentation or customization: it's a lack of a very basic feature
did you filed an issue?
Agreed and I'm in the process of doing so
awesome!
Are you certain there is no duplicate issue? I can't seem to find any but just making sure as I usually don't do this
check with
is:closed
if you haven't already
Worst case if it's a duplicate they'll link to it when they review itnot really, but if there's a duplicate one, it will be closed
you did your best effort and that's important
your due diligence
GitHub
Unable to modify freeMode.enabled after initialization · Issue #775...
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 "en...
cannot wait to be yelled at for improperly opening an issue in some way
yeah it really doesn't seem like anyone else has
how strange
It seems like quite a well known library
does everyone just deal with it by making workaroudns
haha thank you
lets just say that most people follow 2 paths:
1- use something else
2- just grumble and use workarounds
it's rare for people to open issues
Yeah I suppose, although I also understand why
It is very common for developers to take issue formatting super serious and discourage any future issue posting. Even for simply requesting help in some discord server
just like with stackoverflows reputation
i agree, it discourages
but some people go waaaaaaaaaaaaaaaaaaaaaay overboard
if you don't dot your t's and cross your i's, your issue is deleted
haha comes from a lack of control in other matters in life I suppose
maybe, or tired of people putting the foot on their mouth with simpler instructions
perhaps
i understand it, it's what i mean