Problem/Motivation
The first focused element on the modal once it's opened is typically the first link that appears inside the project description. However, not all project descriptions have a link. It's possible for a non-sighted user to miss the description, for example.
See https://www.drupal.org/project/project_browser/issues/3310908#comment-15... for more background.
Steps to reproduce
use project browser, find a project, click its title to open the modal "detail page"
Proposed resolution
MAYBE: add a focusable element (The title?) to the modal?
MAYBE: make the first focusable element the close button?
Comments
Comment #4
utkarsh_33 commentedI have implemented one of the two suggestions.
Comment #5
narendrarAsserting focus in exiting modal test can be helpful here.
Comment #6
rkolleradding a tabindex to non-interactive is not adviced (see for example https://www.a11yproject.com/posts/how-to-use-the-tabindex-attribute/). https://html.spec.whatwg.org/dev/interactive-elements.html#the-dialog-el... suggests
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog suggests:
i would rather lean toward the smallest commone denominator between the two aka focus on the dialog element itself instead of focusing on the close button cuz the intend of the dialog modal is that some browsing of the content and interaction with the elements in the modal happens. but i guess it would make sense to also start thinking and opening a follow up issue about the general structure of the dialog modal content (implementing the things we'Ve learned from the survey and which got aggregated into the quality indicators.png)
Comment #7
utkarsh_33 commentedNot sure whether there is a better way of doing this but now the focus is on the modal element.Marking it NR.
Comment #8
narendrarTested manually and focus is now set on modal. Moving it to RTBC.
Comment #9
rkollerthanks for the changes... the dialog modal getting the initial focus looks good... but i've noticed several more problems in the context of the a11y within the dialog modal. so far i have only tested it with modules that havent had an image carousel, plus i havent taken a closer look with voiceover active neither (see and hear dialog.mp4 and voiceover.mp4).
slide leftandslide rightbuttons but no content you the user are sliding inbetween.slide rightbutton, you press return and the button turns disabled and you press shift-tab to get back to theslide leftbutton you get to thelearn morebutton instead?!i set the issue back to needs work. the other option might be to move some of those points to follow up issues to keep the scope for this issue, but due to the fact that this issue is about the a11y of the dialog modal i set it back to needs work for now
Comment #10
chrisfromredfinActually, each of these bullets should be its own sub-issue. If you want to collect all modal-related a11y issues, you can do a meta and do each bullet as a child; but, we need to keep scope as SMALL as possible for issues. Moving this one back to RTBC.
Comment #11
chrisfromredfinComment #13
chrisfromredfinThere will be more a11y fixes coming, but I aim to try to keep them as small and narrowly scoped as possible.