nativescript-slides icon indicating copy to clipboard operation
nativescript-slides copied to clipboard

when use goToSlide, the last panel will still overlay on the top

Open wenhsiaoyi opened this issue 6 years ago • 0 comments

add previousSlide.panel.translateX = 0 to fix the previousSlide to the reset position .

public goToSlide(index: number): void { if ( this._slideMap && this._slideMap.length > 0 && index < this._slideMap.length ) { let previousSlide = this.currentPanel; // fix right translateX value previousSlide.panel.translateX = 0; this.setupPanel(this._slideMap[index]);

  this.notify({
    eventName: SlideContainer.changedEvent,
    object: this,
    eventData: {
      direction: direction.none,
      newIndex: this.currentPanel.index,
      oldIndex: previousSlide.index
    }
  });
} else {
  // console.log('invalid index');
}

}

wenhsiaoyi avatar Jan 29 '19 04:01 wenhsiaoyi