Skip to content

Commit

Permalink
fix carousel item children with anchors
Browse files Browse the repository at this point in the history
  • Loading branch information
evayde committed Nov 5, 2024
1 parent ec01631 commit f084273
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/carousel/carousel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ export default class SlCarousel extends ShoelaceElement {
@eventOptions({ capture: true })
private handleClick(e: MouseEvent) {
if (this.dragging) {
// prevents anchor tags within carousel items from triggering while dragging
e.preventDefault();
// prevents click events within carousel items from triggerin while dragging
e.stopPropagation();
}
}
Expand Down

0 comments on commit f084273

Please sign in to comment.