Make WordPress Core

Opened 9 years ago

Last modified 2 days ago

#42780 assigned enhancement

Code Editor: Linter (HTMLHint) should show error if checkbox doesn't have associated <label>

Reported by: shooper Owned by: tirth03
Priority: normal Milestone: Future Release
Component: External Libraries Version: 4.9
Severity: normal Keywords: early has-patch has-unit-tests
Cc: Focuses: accessibility, javascript, rtl

Description

The Custom HTML Linter should show an error if an checkbox field does not have an associated label element. This would be a good improvement for accessibility.

To reproduce:

  1. Create a custom HTML widget
  2. Enter the following code:
<input type="checkbox"> Checkbox Label
  1. No warning/error appears.

Change History (22)

#1 @westonruter
9 years ago

You could write a custom ​HTMLHint rule to enforce this, but a warning is probably better than an error.

This ticket was mentioned in ​Slack in #accessibility by afercia. ​View the logs.


9 years ago

#3 @afercia
9 years ago

  • Focuses javascript added
  • Version trunk → 4.9

Discussed during today's accessibility bug-scrub. Yes it would be great to have the linter warn for accessibility errors, not just the ones related to a checkbox though :) Will defer the decision to the editor and widgets teams, as we're not even sure it's technically feasible.

This ticket was mentioned in ​Slack in #accessibility by afercia. ​View the logs.


9 years ago

#5 @westonruter
9 years ago

  • Component Widgets → General
  • Milestone Awaiting Review → Future Release
  • Summary Custom HTML Widget Linter should show error if checkbox doesn't have associated <label> → Code Editor: Linter (HTMLHint) should show error if checkbox doesn't have associated <label>

#6 @netweb
9 years ago

  • Keywords needs-patch added

There's a pull request for HTMLHint already created, sadly not merged for this:

Unfortunately, it appears the HTMLHint project is unmaintained for now, there's been ​no response from the maintainer in ~6 months, there are quite a few forks though I'm not sure if it would be possible to use a fork

This ticket was mentioned in ​Slack in #accessibility by rianrietveld. ​View the logs.


8 years ago

#8 @sabernhardt
6 years ago

That ​pull request was merged in HTMLHint earlier this year.

This ticket was mentioned in ​Slack in #accessibility by sabernhardt. ​View the logs.


6 years ago

#10 @sabernhardt
6 years ago

  • Component General → External Libraries

The current HTMLHint version included in WordPress is 0.9.14, and the first version with the label-checking feature was 0.13.0

This ticket was mentioned in ​Slack in #accessibility by ryokuhi. ​View the logs.


6 years ago

This ticket was mentioned in ​Slack in #accessibility by joedolson. ​View the logs.


2 years ago

#13 @joedolson
2 years ago

  • Milestone Future Release → 6.8
  • Owner set to joedolson
  • Status new → accepted

I'm highly favorable to having improvements that can help guide users better. It looks like HTMLHint has been updated quite a bit in the last few years, and it's worth looking at updating this.

I'm going to milestone this for 6.8, and look into updating HTLMHint.

This ticket was mentioned in ​Slack in #accessibility by joedolson. ​View the logs.


2 years ago

#15 @joedolson
2 years ago

  • Owner changed from joedolson to tirth03
  • Status accepted → assigned

This ticket was mentioned in ​Slack in #accessibility by joedolson. ​View the logs.


22 months ago

#17 @joedolson
22 months ago

  • Keywords early added

Since this updates a major library used in core, I think this should probably be marked as early.

This ticket was mentioned in ​Slack in #core by audrasjb. ​View the logs.


22 months ago

This ticket was mentioned in ​Slack in #core by audrasjb. ​View the logs.


22 months ago

#20 @audrasjb
22 months ago

  • Milestone 6.8 → Future Release

As the ticket is marked early and don't have any patch yet, let's move it to Future Release.

This ticket was mentioned in ​PR #11467 on ​WordPress/wordpress-develop by ​@sukhendu2002.


7 months ago
#21

  • Keywords has-patch has-unit-tests added; needs-patch removed

#22 @sukhendu2002
2 days ago

I’ve opened [PR #11467](​https://github.com/WordPress/wordpress-develop/pull/11467) to enable HTMLHint’s input-requires-label rule in the code editor’s default settings.

This adds a warning for inputs without a matching label, including the checkbox example in this ticket.

Testing and feedback would be appreciated. Thanks!

Note: See TracTickets for help on using tickets.