NickPiscitelli/Glider.js

glider-slide-visible doesn't fire when scrolling when slidesToShow === 1

kevinfarrugia opened this issue · 0 comments

glider-slide-visible fires whenever a slide is visible in the glider. This works correctly in most cases, however when the slidesToShow is set to 1, the event doesn't fire when scrolling (using a touchpad or touch device) while it fires when using the dots or arrows.

Reproducible Example
https://codesandbox.io/s/glider-js-glider-slide-visible-mlb6w2

Code

new Glider(document.getElementById("glider-1"), {
      slidesToShow: 1,
      dots: ".dots",
      draggable: true,
      arrows: {
        prev: "#glider-prev-1",
        next: "#glider-next-1"
      }
    });

    document
      .getElementById("glider-1")
      .addEventListener("glider-slide-visible", () => {
        console.log("slide-visible");
      });

Expected Outcome
It is expected that glider-slide-visible would fire similarly to when slidesToShow !== 1.