Skip to content

Commit

Permalink
Merge pull request #14 from Travelopia/feature/slider-event-update
Browse files Browse the repository at this point in the history
Add Index On 'slide-set' Event
  • Loading branch information
junaidbhura authored Dec 14, 2023
2 parents d1b0c3d + 1d85314 commit bfc50f6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/slider/tp-slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ export class TPSliderElement extends HTMLElement {
return;
}

this.dispatchEvent( new CustomEvent( 'slide-set', { bubbles: true } ) );
this.dispatchEvent( new CustomEvent( 'slide-set', {
bubbles: true,
detail: {
slideIndex: index,
},
} ) );
this.setAttribute( 'current-slide', index.toString() );
}

Expand Down

0 comments on commit bfc50f6

Please sign in to comment.