imgix-rails icon indicating copy to clipboard operation
imgix-rails copied to clipboard

ix_picture_tag helper sets custom alt: attribute on the <picture> tag instead of <img> tag

Open amdixon opened this issue 7 years ago • 1 comments

Rails' regular image_tag helper allows an optional alt: option to be passed in. However, in your helpers, notably the ix_picture_tag, the alt: option when passed in is applied to the <picture> tag rather than the <img> tag which is the HTML standard.

For example:

<%= ix_picture_tag(url,
  picture_tag_options: {
    alt: "Some custom alt text"
  }
) %>

will result in:

<picture alt="Some custom alt text">
  ...
  <img>
  ...
</picture>

Where the behavior should be (ideally):

<picture>
  ...
  <img alt="Some custom alt text">
  ...
</picture>

amdixon avatar Mar 11 '17 21:03 amdixon

Related to #101

sherwinski avatar Dec 03 '20 19:12 sherwinski