question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Settings aren't working correctly for breakpoints

See original GitHub issue

First of all I want to say that I am very happy with Glide.js! I noticed a bug (I think) though when it comes to defining breakpoints.

const glide = new Glide('.glide', {
  type: 'slider',
  perView: 3,
  bound: true,
  gap: 10,
  dragThreshold: false,
  breakpoints: {
    1024: {
      startAt: 0,
      perView: 2,
      dragThreshold: 120,
    },
    600: {
      startAt: 0,
      perView: 1,
      dragThreshold: 120,
    }
  },
});
glide.mount();

I have a slider with 3 items, which I want to show next to each other. The dragThreshold is set to false, so that it is not possible to navigate. But when the screen is getting smaller I want the enable the dragThreshold (when it fires the breakpoint). But this doesn’t work, as you can see in my pen: https://codepen.io/jfrdfr/pen/QXwNNj

I also noticed that the ‘startAt’ option is not working for breakpoints. When I am navigating the elements on a smaller device (for example when perView is set to 1), but when it hits another breakpoint it doesn’t reset the slide back to the 0 index.

I hope you could help me out with this! Maybe I am using it wrong (or expecting wrong results).

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
VeeDoubleYuhcommented, Aug 29, 2020

Hey guys, sorry to bump. But I was having this issue and solved it for myself, so you (or any future readers) may have overlooked the same thing I did.

At the very bottom of this page, the docs remind you to pull in all modules that you need – not just Glide. So I had forgotten both , { Breakpoints } in my import and { Breakpoints } in the mount() call at the end.

2reactions
ghostcommented, Jun 18, 2020

Sorry for the late reply, I have tried the latest version (3.4.1) and sadly it doesn’t work as I expect it to. I’m currently using Firefox 77.0.1 on Windows. I’ve made a new pen to showcase my issue: https://codepen.io/Afgedankt/pen/vYLgKgP

dragThreshold: The slider I was using had three slides. On desktop I wanted to disable the threshold, so that the visitor can’t move the slides (in a way that is disabling the slider). When resizing the browser it will eventually show two slides, but sadly the threshold is still disabled, even though I specified it in the breakpoint. This also happens the other way around: when the two slides are visible (threshold is then enabled) and resize it until I see three slides again, the threshold isn’t disabled.

startAt Almost the same behaviour exists for this option. I’m expecting that when I hit a new breakpoint the slider resets back to the first slide.

Again, maybe I’m using this wrong. It does look like when a breakpoint is hit not all the options are processed in the slider.

Hope I made myself more clear! Anyway, still enjoying the plugin 😃 Hope this issue will get fixed, so that I can use it for more projects!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Breakpoints in the Visual Studio Debugger
Go to the Modules window (Debug > Windows > Modules) and check whether your module is loaded. If your module is loaded, check...
Read more >
BreakPoints Are Not Working in Visual Studio - C# Corner
BreakPoints Are Not Working in Visual Studio · Solution: Start debugging. · Solution: Right-click the Solution in Solution Explorer, click "clean ...
Read more >
break point is not hitting while debugging - Stack Overflow
1- Right mouse click your project · 2- select [Properties] · 3- select [Build] tab · 4- make sure [Define DEBUG constant] and...
Read more >
Breakpoint Troubleshooting in the RStudio IDE - Posit Support
Setting breakpoints Nothing happens when clicking in the gutter ... the editor does not know which function to place the breakpoint in, ...
Read more >
Xcode 13: Active breakpoint turns to an outline when app is run.
Breakpoints work as expected on an app started in Xcode 13.1. ... I think your answer is correct but, honestly, I'm not sure....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found