openui / openui/open-ui

Link delegation to descendant

Open
#1,104 35 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

a11y-tracker
Dominant language
MDX
Stars
4.5k
Forks
226
Avg merge
2d 22h
Merged PRs (30d)
4

Description

As per spec, the a element cannot nest, you cannot put links inside links.
This is important from an a11y perspective and for other reasons.
However, many websites today (e.g. Reddit, Rotten Tomatoes) implement this kind of link "nesting" on their own with somewhat verbose javascript.

Proposing to discuss finding a web platform solution for this that would take accessibility and ergonomics into account.
This solution might look like link delegation

<section link="item1-link">
   <link id="item1-link" href="details?item=1">
</section>

In the above example, the link attribute of the section element "delegates" the link to an a (or area) descendant with the given ID. UAs should implement this by making the section's default click action delegate the click to the item1-link element, and they may support it in other UI such as right-clicking the section.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed link attribute, the section and a/area example, and the stated accessibility and ergonomics concerns. Research the relevant web-platform behavior and existing approaches used by sites such as Reddit and Rotten Tomatoes. Done means the issue has a decided, accessibility-conscious platform direction rather than only an open request for discussion.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
accessibility, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.