argyleink / argyleink/gui-challenges

dialog gui challenge - mega modal markup oddities

Open
#205 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
3k
Forks
389
PR merge metrics
No merged PRs in 30d

Description

regarding: https://web.dev/building-a-dialog-component/

it's mentioned that the footer, header and article elements are semantic containers - but there's little explanation as to why they're there, or the impact they'll have for people using screen readers.

In reality, these don't serve much purpose in the context of the dialog - header/footer _should_ generally be treated as generic in these cases - though not consistently. So these may also be exposed as banner/contentinfo landmarks, which adds verbosity with little gain. Similar to the article element which will be exposed as an unnamed article container, which at worse requires someone have to perform additional navigational steps to reach the inner content (for instance, if using VO navigation keys). At best, similar to the header/footer elements, just adds extra verbosity to this dialog.

Similarly, the use of the `menu` element invalid here. The `menu` element is another type of list element - specifically referenced in the spec as being similar to `ul`. As such, it expects `li` elements as its direct children, but you've just put buttons in there. This is "fine" for the most part, in that some browsers/AT mitigate against this error by not exposing the list semantics and thus treating this no differently than `div > button`. But not NVDA, as one example, where when used with Chrome/Edge it informs me that i've entered a list, but as there are no list items i can't navigate by them. Since it doesn't appear that you want to visually expose this as a list - particularly since the rendered demo even uses two separate instances of `menu > button`s, it probably makes more sense to just turn these into divs as well.

Snippet of the rendered markup I grabbed using dev tools:
```


Clear


Cancel
Confirm

```

If you did want this to be exposed as a list, seems reasonable to have a single menu, and then li's containing the 3 buttons. That too may be a bit more chatty than someone actually needs, but it'd be valid markup then and not have inconsistent exposure to AT.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the dialog challenge implementation and the rendered markup shown in the issue, then compare the header, footer, article, and menu elements with their screen-reader exposure and HTML requirements. Done means the dialog uses appropriate semantic containers and valid button grouping without unnecessary or misleading accessibility announcements.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
accessibility, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.