whatwg / whatwg/html

A `<label>`'s activation behavior shouldn't be platform specific

Open
#4,516 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

interop topic: forms
Dominant language
HTML
Stars
9.4k
Forks
3.2k
Avg merge
3d 9h
Merged PRs (30d)
38

Description

The first example of the label element contains:

"For example, on platforms where clicking a checkbox label checks the checkbox, clicking the label in the following snippet could trigger the user agent to fire a click event at the input element, as if the element itself had been triggered by the user:"

Tests on different platforms (Ubuntu, Windows, OSX) have shown the behavior there is the same. At least for Chrome and Firefox (although their behavior differs in at least one case, but is consistent across all platforms).

Instead, it seems the dispatch algorithm should account for changing the target to the labeled control, if existing. I'll file a separate issue for that at whatwg/dom and link it here.

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

Read the label element example in the HTML Standard and compare it with the linked DOM dispatch algorithm and labeled-control definition. Verify the reported cross-platform behavior, then determine whether the HTML wording or the DOM algorithm needs adjustment; done means the relevant specification text consistently describes the intended behavior and coordinates with the separate whatwg/dom issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.