glide icon indicating copy to clipboard operation
glide copied to clipboard

Nested Sliders

Open jrussnone opened this issue 5 years ago • 8 comments

I'm trying to implement nested sliders, however I'm having the issue where the controls for the parent and child sliders are affecting each other. I can see that this issue is due how the Controls component is searching for the control elements, however I'm not too sure how to best approach this.

Is it possible to overwrite the control elements for a slider, or will I need to overwrite the component mount functions to have a more specific selector for the controls?

jrussnone avatar May 27 '19 02:05 jrussnone

I'm also having the same problem, any solution?

pkjindal111 avatar Jul 25 '19 09:07 pkjindal111

Same problem here.

I've partially fixed it here => https://github.com/xfra35/glide/commit/9b52b374fb49ebeb0c7a502b93eb0d256b78ba08

I don't open a PR as it's a partial fix only: it fixes interferences between nav/arrow controls but not swipe interferences.

As a quick workaround, I've disabled swipe on nested sliders by setting swipeThreshold and dragThreshold to 0.

If you need the patched 3.3.0 compiled version (as I did), it's there => https://github.com/xfra35/glide/commit/4d4b9cedb66aa05739ba7c19d7a50623df1b736c

xfra35 avatar Dec 05 '19 19:12 xfra35

Hi there 👋

I'm having the same issue. I've made a pen to show what's going on with controls : https://codepen.io/manueltaraud/pen/abZNWBw

To resolve it, I thought to leave the possibility of changing the selector of the track or controls. data-card-el="track" instead of data-glide-el="track" and an option glideSelector: '[data-card-el]'.

Manours avatar Oct 16 '20 14:10 Manours

Hi, I love your plugin.

I have been looking for a similar plugin for Vue3 for a few days now and I must admit it was a relief when I found yours. However after trying several ways to nest a glide, I found this issue.

Is it possible to add this feature @jedrzejchalubek ?

Thanks a lot !

Sorrow81 avatar Feb 05 '22 00:02 Sorrow81

Same problem here.

I've partially fixed it here => xfra35@9b52b37

I don't open a PR as it's a partial fix only: it fixes interferences between nav/arrow controls but not swipe interferences.

As a quick workaround, I've disabled swipe on nested sliders by setting swipeThreshold and dragThreshold to 0.

If you need the patched 3.3.0 compiled version (as I did), it's there => xfra35@4d4b9ce

How can we fix in case of using in React project? Where do we need to set this code? What if some one update the package?

drashtibpatel avatar Feb 11 '22 13:02 drashtibpatel

I'm having the same issue.

dlopez-akalam avatar Nov 07 '22 13:11 dlopez-akalam

I can confirm that the fix described in https://github.com/glidejs/glide/issues/365#issuecomment-562278037 fixed the issue for me. Would be nice to see this fix in the main repository.

dlopez-akalam avatar Nov 07 '22 14:11 dlopez-akalam

Fixed this in usage of the plugin itself. Here is the example - https://github.com/karthik2706/glide-nested-carousel

//Disable parent slider when child arrows are clicked
glide.on('move', function() {
    outerGlide.disable();
    console.log('outer disabled')
});
//Enable parent slider after child slide move is completed
glide.on('move.after', function() {
    outerGlide.enable();
    console.log('outer mounted')
})

karthik2706 avatar Sep 29 '23 15:09 karthik2706