Shopify Dawn Theme: Mobile Slider is not working anymore

Hello I have a problem on my website.

I tried to make a sepparate component for the product-media-gallery component to be able to show variant images from a metafield. I’ve tried as much as possible to keep the same logic only thing modified to be the image urls since those are taken from the metafield.

Currently the slider-component won’t work anymore on mobile, see example here.

Can you guys help me with a tip, where to look for? It seems like the scrollTo method is not updating the scrollLeft property and also not triggering an update.

1 Like

Hi @jujucro

You are using the old Dawn theme version, please try to download newest version and check if it fix your issue.

Hello, thanks for your reply
This theme is a fork from dawn theme it will take a bit longer to update. Thing is that the old product-media-gallery works just fine, the problem appears when I try to duplicate it and modify it to show metafield images. It does not work the same, it must be a bug but I can’t figure it out why the scrollTo method is not working anymore.

Hi @jujucro

Your slider component does not work because the slider component is basing on media.id which your current images does not have. You will need to have a different code for the slider to work.

I would suggest to ditch out the slider component if you are not using it in desktop, e.g. thumbnail slider. In mobile, customer will be able to slide the images by swiping. You do need to configure your CSS code with this.

Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!