-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Duplicated HTML id
due to Hydrogen <Image />
#624
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
Yeah, I think this makes sense. That was on there before I started working on components, so I don't have context on the reasoning it was added in the first place. But I think it should be removed if no one has a concrete reason for adding it; I'll ask around. |
I started looking into this, I think there is an underlying design question about setting an ID or not to the HTML image tag. The Not setting an ID at all may not be ideal for all use-cases. Currently we set the ID coming in Thoughts @frehner, @davidhousedev? Also I noticed that we're setting it to an empty string |
I genuinely don't know; is there any value in us always setting an ID for it? My initial impression is that I don't think there is, but I could be missing some important reason as to why we would want to do it. |
Describe the bug
In our designs on Product Details Page, we have a series of image thumbnails with one image that's "selected" and displayed large. We are using the Hydrogen
<Image />
component which has the default behavior of setting the HTMLid
to the underlying id of the image. The result is that we have two<img>
s on the page with the sameid
.To Reproduce
<Image />
components, each that renders the same image<img>
s that share the sameid
Expected behaviour
I would not expect the Hydrogen
<Image />
to set anid
. If it did, I'd expect the underlying behavior to guarantee uniqueness viauseId
or the like.Screenshots
Additional context
Add any other context about the problem here. eg.
Hydrogen 1.2.0
The text was updated successfully, but these errors were encountered: