From d1f722492bcb03c13db015108b13d70a032c4768 Mon Sep 17 00:00:00 2001 From: Alquen Antonio Sarmiento Date: Thu, 8 Aug 2024 10:25:17 +0800 Subject: [PATCH] fix(horizontal-scroller): set draggable to false for images inside horizontal scroller --- .../horizontal-scroller/frontend-horizontal-scroller.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/block/horizontal-scroller/frontend-horizontal-scroller.js b/src/block/horizontal-scroller/frontend-horizontal-scroller.js index c7ba14085..28dec41d3 100644 --- a/src/block/horizontal-scroller/frontend-horizontal-scroller.js +++ b/src/block/horizontal-scroller/frontend-horizontal-scroller.js @@ -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()