Skip to content

Commit 1d85314

Browse files
committed
Add index on 'slide-set' event
1 parent e2bdf7f commit 1d85314

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/slider/tp-slider.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,12 @@ export class TPSliderElement extends HTMLElement {
152152
return;
153153
}
154154

155-
this.dispatchEvent( new CustomEvent( 'slide-set', { bubbles: true } ) );
155+
this.dispatchEvent( new CustomEvent( 'slide-set', {
156+
bubbles: true,
157+
detail: {
158+
slideIndex: index,
159+
},
160+
} ) );
156161
this.setAttribute( 'current-slide', index.toString() );
157162
}
158163

0 commit comments

Comments
 (0)