Open kristiansp opened 1 year ago
Same issue here - and it's a really bad issue, as it means it's impossible to navigate using transition between routes. If I navigate to another page, you end up seeing carousel styling get removed for a split second, making it look horrible. There should be a way to either delay destroying or fixing the block
issue described here
Same issue here, can we have it fixed please?
Same issue here - and it's a really bad issue, as it means it's impossible to navigate using transition between routes. If I navigate to another page, you end up seeing carousel styling get removed for a split second, making it look horrible. There should be a way to either delay destroying or fixing the
block
issue described here
Same issue here in Nuxt 3 page transition.
temporarily fixed with following code
.splide { &.is-initialized:not(.is-active) { .splide__track { .splide__list { display: flex; .splide__slide { width: 100%; } } } } }
Does anyone have a good suggestion what would be the best approach for this to work? Then maybe we could make a pull request for it. There are multiple ways to go about it, I guess, and I haven't looked at it in a while.
The reason it happens, I guess, is that the flex
that Splide uses to work is set on the splide__list
class itself. So when destroying, the display
property has to be set to something. Or just remove the class, of course, but that would have other consequences (the possibility to re-initialise the slider, for instance, as Splide requires it to be there). That's probably not intentional in and of itself.
Checks
Version
v4.1.3
Description
I'm using SplideJS as a slider, and in a redesign I want the slider only to be on mobile, and to use a flexbox layout on larger screens. Destroying the slider with breakpoints is easy enough, the problem is that Splide forces the
splide_list
element to havedisplay: block
when it is initialised, which then overrides the flex setting.Since Splide forces the structure
track > list > slide
, the flex kind of has to be on the list element.Even with
destroy: 'completely'
it sets the following class:This must be a fairly common scenario, to not being forced to have a block element holding all the items when destroying the slider?
Reproduction Link
No response
Steps to Reproduce
display: block
set, overriding the desired flex layoutExpected Behaviour
I've tried setting the slider to
destroy: true
anddestroy: 'completely'
with the breakpoint setting, and it destroys alright, but the CSS is still forcing thesplide_list
to be a block element. I would expect it not to set any specificdisplay
setting on this element once the slider is destroyed.