[wp-trac] [WordPress Trac] #59733: Disabled form controls should not use cursor: pointer

WordPress Trac noreply at wordpress.org
Tue Oct 31 07:43:39 UTC 2023


#59733: Disabled form controls should not use cursor: pointer
-----------------------------------------+---------------------------------
 Reporter:  afercia                      |       Owner:  afercia
     Type:  defect (bug)                 |      Status:  assigned
 Priority:  normal                       |   Milestone:  6.5
Component:  Administration               |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  has-screenshots needs-patch  |     Focuses:  ui, accessibility,
                                         |  css
-----------------------------------------+---------------------------------

Comment (by afercia):

 [attachment:"59733.diff"] is a proof of concept to illustrate what are the
 challenges for this apparently simple task.

 Inputs and select elements are pretty simple to address.
 Instead, the label elements are a little more challenging.

 - Wrapping labels are pretty simple to address. The patch uses the
 `:has()` functional CSS pseudo-class to target `<label>` elements that
 wrap a disabled form control. As far as I can tell this should work in all
 cases, as a label is supposed to contain only one form control. It's the
 first time core would use `:has()`, but it is already used in the
 Gutenberg editor.
 - The challenge is with non-wrapping labels associated with for / id
 attribute:
   - They could be before the form control (e.g. for text inputs).
   - They could be after the form control (e.g. for radio buttons and
 checkboxes).
   - They could be not immediately adjacent to their associated form
 control.
   - They could be preceded or followed by _other_ disabled form controls
 or labels.

 I couldn't think of a solid way to target with CSS all non-wrapping labels
 of disabled controls. Any thoughts more than welcome.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59733#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list