Conversation
chandlerprall
left a comment
There was a problem hiding this comment.
Code changes LGTM; pulled and tested functionality locally, would be best to have a designer approve as well.
There was a problem hiding this comment.
Looks like this is still missing hover and focus states while in the actual full screen mode.
Maybe also displaying a cross icon on hover while in full screen mode will help to indicate that clicking will exit full screen?
As we discussed on zoom, I think the slight shadow change may be too subtle, at least for the focus state. See if there's a way to use the focus ring variables or mixin?
|
How'd you feel about tackling some of the other a11y issues with images as well? 🙏 TL;DR my proposed final markup (including the optional So, why these changes?
Other notes
|
|
Thanks @myasonik ! However, I think all of that is out of scope of this PR. This PR is mainly to just address the missing |
|
@cchaos when I've seen your comment I was almost finishing the a11y suggestions. @myasonik and @cchaos here's what I implemented so far:
@cchaos can you review the new focus and hover states? |
cchaos
left a comment
There was a problem hiding this comment.
@myasonik @miukimiu It seems to me that there's an even simpler approach to the clickability other than using :focus-within and absolute positioning the button.
The spec states that <figure> can contain any flow content. A <button> is a type of flow content. Therefore, we can wrap the <img> tag with the <button> but inside of <figure> like so:
<figure role="figure" aria-label={figcaption}>
<button aria-label={`Show ${alt} image full screen`}>
<img src={src} alt={alt} />
{fullScreenIcon aria-hidden="true"}
</button>
<figcaption>{figcaption}</figcaption>
</figure>
cchaos
left a comment
There was a problem hiding this comment.
This is great! I think pushing off the a11y work to another PR is a good idea as to separate the concerns and just focus on actually fixing the issue referenced.
Just saw a typo and want to make sure you've tested in other browsers, but visually it works well and the code looks good! 👍
| cursor: pointer; | ||
| &.euiImage--allowFullScreen { | ||
| &:focus .euiImage__img { | ||
| outline: 2px solid $euiFocusRingColor; |
|
@miukimiu #2328 merged, so I'll get the conflicts sorted for you |
|
jenkins test this |
Summary
Closes #1983
Added hover and focus states when
allowFullScreenis true in EuiImage.Non-clickable images were being wrapped by a button so I removed the button for images that aren't clickable.
Checklist