You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When changing the variant on the product page, it updates the image (if the variant has an image associated to it) and prepends it to the <ul>.
The checks being done in updateMedia() in the variant.js file doesn't check if the current media that is first in the list is already that same media. So for example, I was trying to add something to scroll back up to the top of the list when the media changes. The problem is that it gets triggered even when the image is actually not changing.
Describe the expected behavior
I think updateMedia() should only run if the media changes. If the media for White 32 is the same for White 36 we should run the function.
Version information (Dawn, browsers and operating systems)
Dawn Version: 1.1.0
Chrome Version 91.0.4472.114
macOS Version 11.3.1
Possible solution
Compare this.currentVariant?.featured_media with the first item in the parent's first element.
Additional context/screenshots
Video
The text was updated successfully, but these errors were encountered:
Describe the current behavior
When changing the variant on the product page, it updates the image (if the variant has an image associated to it) and prepends it to the
<ul>
.The checks being done in
updateMedia()
in thevariant.js
file doesn't check if the current media that is first in the list is already that same media. So for example, I was trying to add something to scroll back up to the top of the list when the media changes. The problem is that it gets triggered even when the image is actually not changing.Describe the expected behavior
I think
updateMedia()
should only run if the media changes. If the media forWhite 32
is the same forWhite 36
we should run the function.Version information (Dawn, browsers and operating systems)
Possible solution
Compare
this.currentVariant?.featured_media
with the first item in theparent
's first element.Additional context/screenshots
Video
The text was updated successfully, but these errors were encountered: