Expose coordinates as fields for accessibility

Created on 16 December 2020, about 4 years ago
Updated 8 May 2024, 8 months ago

Problem/Motivation

It isn't obvious that one can set Focal Point coordinates using only keyboard controls. Fine motor control and good vision are both necessary to reposition the crosshairs over a small thumbnail or to double-click on the crosshair to expose the field (and there are no visible instructions saying that's how that works).

Proposed resolution

Make it more obvious to keyboard users that they can change the Focal Point x and y coordinates without using a mouse.

Remaining tasks

  1. Move the coordinates field directly after the crosshair which performs the same task for mouse users, so it's in the tab order where one would expect the crosshair to be.
  2. Consider adding a visible link to expose the field, or some instruction so users with limited vision or motor control know how to access the coordinates field without having to click a small target over a small thumbnail.

User interface changes

Users would easily understand how to set the Focal Point by dragging the crosshair with their mouse, or by entering x/y values with their keyboard.

API changes

None.

Data model changes

None.

๐Ÿ“Œ Task
Status

Needs review

Version

1.0

Component

Other Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States Kasey_MK

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States Kasey_MK

    Re-roll for 2.1.0

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia aman1248

    Hello @bleen and @Kasey_MK, the patch !11 has been reviewed and tested. It's working fine .

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom the_g_bomb

    Updating the version, so an appropriate issue fork can be created.

  • Pipeline finished with Success
    about 2 months ago
    Total: 160s
    #325210
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    Added the issue to the a11y meta and added the the wcag211 tag for now (might need more wcag tags)

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    At first thanks to @kasey_mk for all the work on the issue and @the_g_bomb for moving the patch in #11 ๐Ÿ“Œ Expose coordinates as fields for accessibility Needs review into merge request. I've tested MR42, a few thoughts and observations:

    In general some work might be needed stylingwise. I've tested on 11.x and focal_point 2.x using Safari 18.1. On a desktop viewport the image fieldset looks like that:

    While on a mobile viewport there is no linewrapping and the entire description is getting crammed into a single line:

    In general I love the idea of progressive disclosure showing Click and drag the indicator to set the focus of this image, or double-click the indicator for a text field to change the focal point offsets. only when javascript is available. but i wonder when no javascript is available and the description is hidden why the white cross of the focal point is still shown? wouldnt it make sense to hide it as well?

    in regard of the behavior for screenreader users. first i consider it confusing that the focal point field is placed in different positions depending on if javascript is available or not. Without Javascript it is at the end of the fieldset

    While with javascript available it is at the first position in the fieldset:

    It feels also rather odd and confusing that the focal point field is first hidden and only shown when it gets into keyboard focus. In that case it is not a progressive disclosure that first a criterion has to be met but the user just has to tab until they reach the focal point field. if you have a sighted keyboard user who is reading "Click and drag the indicator to set the focus of this image, or double-click the indicator for a text field to change the focal point offsets." there is no indication that the feature is keyboard accessible nor that the focal field will get unhidden when it gets into focus. the description is only about mouse interaction. So i wonder if it wouldnt be the better choice to make the focal point field visible all the time for everyone in every context?

    In regards of the syntax used on the focal point field, having something like 50,50 along with instructions like "Specify the focus of this image in the form "leftoffset,topoffset" where offsets are in percents. Ex: 25,75 " is sort of challenging. would it be an idea, instead of having one input text field, having two input number fields. that way the keyboard user would be able to either type in the number or use the up and down arrow key changing the value, plus a failsafe could be added only allowing integer values with a minimum value of 1 and a maximum value of 100?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States Kasey_MK

    Thanks for your thorough review, @rkoller! For what it's worth, my responses:

    In general some work might be needed stylingwise

    Agreed! I think I ended up changing styles in my own theme; it didn't occur to me that that might be an issue to solve in focal_point.

    in regard of the behavior for screenreader users. first i consider it confusing that the focal point field is placed in different positions depending on if javascript is available or not

    It does make sense to have it in the same position. If I recall correctly, I couldn't figure out how to move the field without JS.

    i wonder when no javascript is available and the description is hidden why the white cross of the focal point is still shown? wouldnt it make sense to hide it as well?

    I think it makes sense to show the crosshairs regardless, since they provide a visual confirmation of the values in the offset field(s) for those who can see it. I like that changing the values using either input automatically updates the other.

    So i wonder if it wouldnt be the better choice to make the focal point field visible all the time for everyone in every context

    I have no objection to that, personally. If I recall correctly, I was aiming to change as little as possible, but in general I'd think it would be much more accessible and easy to use to just give everyone access to the same tools instead of trying to guess exactly what tools any individual user might need and then anticipate how they'd find them.

    In regards of the syntax used on the focal point field, having something like 50,50 along with instructions like "Specify the focus of this image in the form "leftoffset,topoffset" where offsets are in percents. Ex: 25,75 " is sort of challenging. would it be an idea, instead of having one input text field, having two input number fields. that way the keyboard user would be able to either type in the number or use the up and down arrow key changing the value, plus a failsafe could be added only allowing integer values with a minimum value of 1 and a maximum value of 100?

    I like that idea, though it's been a long time since I looked at the code and I don't know how difficult that kind of change would be. At the very least, I'd try to make the instructions more human friendly, maybe replacing "leftoffset,topoffset" with "[left offset],[top offset]" or explaining it with a little less tech-speak.

    I don't know if I'll get some time to take another crack at this, but if no one else picks it up before I get back here, I'll leave a comment to say I'm giving it another whirl.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia kim.pepper ๐Ÿ„โ€โ™‚๏ธ๐Ÿ‡ฆ๐Ÿ‡บSydney, Australia
Production build 0.71.5 2024