ganlanyuan/tiny-slider

Please provide method to refresh edgePadding and gutter or allow clamp values

nlighteneddesign opened this issue · 0 comments

Issue description: There is no way to refresh gutter and edgepadding after build.

We have a complex calculation for edge and gutter in order to line up with content above that uses clamp settings. We've attempted the refresh method, but that does not recalculate the spacing.

This could be resolved if we could put clamp as the values instead of an integer as well.

NB in the demo below the positionInfo does calculate the correct value on refresh, but it does not translate to the gutter.

Demo link/slider setting:

this.carousel = tns({
      autoHeight: false,
      autoplay: false,
      center: true,
      container: this.lightDom.carousel,
      controlsContainer: this.dom.controls,
      edgePadding: this.getSpacing().edgePadding,
      gutter: this.getSpacing().gutter,
      items: 1,
      loop: false,
      mouseDrag: true,
      nav: false,
      slideBy: 1,
      onInit: (info) => {
        this.dom.numbersTotal.innerText = info.slideCount;
        this.positionInfo();
      },
    });

Tiny-slider version: 2.9.4
Browser name && version: Firefox 116.0.2
OS name && version: Ubuntu 22.04