Override images in interactive components/variants with zoom effect on hover

Trying to override images so that the image zooms in on hover, but all it does is show the original image from the hover variant. Any ideas? Tks!!

2 Likes

I have the same issueā€¦ My thinking is the bug happens because my image hover state is a component nested inside another componentā€¦ I donā€™t want to detach but this might be the only solution for now? Let me know if you found a workaround.

1 Like

@tank666 this works fine as long as you donā€™t override the images. Or could you figure this out as well?

Have you looked at the file I linked to in the post above? Because it has no problems with overrides.

Hey @tank666 thanks for sharing your example. Iā€™ve been facing the same issue as @vkialka. I did look at your file and tried to fix mine based on yours but no luck. Iā€™m able to replace the default img (ā€˜restingā€™ state in my case) but when I hover, it keeps showing the original one (the one I created the component set with). Iā€™ve also tried changing the image by viewing the componentā€™s ā€œhoverā€ state - but when I view it in presentation mode, the result is the same. Iā€™ve also tried adding a instance swap property and setting the img to it. The default state img changes but on hover it shows the original one only. Hereā€™s my example https://www.figma.com/file/UAH25ZvNQEdyUg6a5sd1vX/Example?node-id=0%3A1&t=GKZZytvSJwBLM8gc-1

Thanks for any ideas on how to fix it.

1 Like

I looked at your file and noticed a difference in the images in variants: one of them you changed the fill mode (crop). Instead, scale the image and place it in a frame with the ā€œClip contentā€ property turned on.

2 Likes

hey @tank666 it worked. Thanks a lot for the help :slight_smile:

Tks so much @tank666. It does work as long as you donā€™t work using aspect ratio images. But tks!!

@Tank found a workaround!! Tks for your help

@tank666 @Karen25 @Simon_Dunford so hereā€™s a file if you guys are interested:

1 Like

try use in the main component blank image place holder.
for example https://www.figma.com/file/7iVbMK4ErjDHZg6kMBewcR/fix-image-issue?t=lDe4lRrXnEjGniq0-1

1 Like

Can we achieve this without making two components?

You cannot create an interactive component with only one component because it requires at least two components (variants) in the component set.

1 Like

can you check this link: https://www.figma.com/file/qCJlIONzcjx6FfMwsGGhb8/FS-West-India-R%26R-Program?type=design&node-id=173%3A2998&mode=design&t=cdZKhGWnhL8dUZlp-1

1 Like

Yes, it is coming from product-tile but the product tile, is created for the master product tile and in that master card there is no variant. Under the image folder, there is a hover and hero image section and I am not sure how this thing changes the image.

I am putting the master component for your reference in that file as well.

Please go to the ā€œProduct-Tileā€ component set rather than ā€œ.main/Product-tileā€ component and study the interactions between variants.

1 Like

Actually, .main/product-tile is the product tile I just renamed that and there is no variant