Skip to content

Commit fe6d23c

Browse files
committed
fix: force all the image in the horizontal scroller to load immediately for height calculation
1 parent 7ffd155 commit fe6d23c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/block/horizontal-scroller/frontend-horizontal-scroller.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ class StackableHorizontalScroller {
1717
// get all links, because we will need to disable them during drag
1818
const children = el.querySelectorAll( '.stk-block-link, a' )
1919

20-
// Get all images and set draggable to false
20+
// Get all images, set draggable to false
21+
// and loading to eager to make the browser calculate the grid height correctly
2122
const images = el.querySelectorAll( 'img' )
2223
images.forEach( image => {
2324
image.draggable = false
25+
image.loading = 'eager'
2426
} )
2527

2628
// prevents redirecting to the inner column link

0 commit comments

Comments
 (0)