Skip to content

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

@wenhsiaoyi

Description

@wenhsiaoyi

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');
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions