Skip to content

Commit

Permalink
fix (horizontal-scroller): set draggable to false for images inside h…
Browse files Browse the repository at this point in the history
…orizontal scroller (#3282)
  • Loading branch information
Arukuen authored Sep 5, 2024
1 parent c1994bb commit 7308fa0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/block/horizontal-scroller/frontend-horizontal-scroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ class StackableHorizontalScroller {
// get all links, because we will need to disable them during drag
const children = el.querySelectorAll( '.stk-block-link, a' )

// Get all images and set draggable to false
const images = el.querySelectorAll( 'img' )
images.forEach( image => {
image.draggable = false
} )

// prevents redirecting to the inner column link
const onClickHandler = function( e ) {
e.preventDefault()
Expand Down

0 comments on commit 7308fa0

Please sign in to comment.