[wp-trac] [WordPress Trac] #55575: Duplicate HTML id attribute in Quick/Bulk Edit

WordPress Trac noreply at wordpress.org
Thu Apr 14 16:21:19 UTC 2022


#55575: Duplicate HTML id attribute in Quick/Bulk Edit
-----------------------------+-----------------------------
 Reporter:  GregLone         |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Quick/Bulk Edit  |    Version:  trunk
 Severity:  normal           |   Keywords:
  Focuses:  accessibility    |
-----------------------------+-----------------------------
 [https://github.com/WordPress/WordPress/commit/337e4a8d9075e8376a3e39c8993ddc8e7d953d65
 This commit] introduced a "static" HTML id attribute `inline-edit-legend`
 in Quick/Bulk Edit forms.
 However, when these forms are both printed in the page, this id then
 duplicated.


 {{{
 <div class="inline-edit-wrapper" role="region" aria-labelledby="inline-
 edit-legend">
         <fieldset class="inline-edit-col-left">
                 <legend class="inline-edit-legend" id="inline-edit-
 legend">Quick Edit</legend>
 ...
 <div class="inline-edit-wrapper" role="region" aria-labelledby="inline-
 edit-legend">
         <fieldset class="inline-edit-col-left">
                 <legend class="inline-edit-legend" id="inline-edit-
 legend">Bulk Edit</legend>
 }}}


 One solution would be to do something like this:


 {{{
 <div class="inline-edit-wrapper" role="region" aria-labelledby="<?php echo
 $bulk ? 'bulk' : 'quick'; ?>-edit-legend">
         <fieldset class="inline-edit-col-left">
                 <legend class="inline-edit-legend" id="<?php echo $bulk ?
 'bulk' : 'quick'; ?>-edit-legend"><?php echo $bulk ? __( 'Bulk Edit' ) :
 __( 'Quick Edit' ); ?></legend>
 }}}


 But by doing this only, the issue is not solved entirely: when using Bulk
 Edit or Quick Edit, the related form is copied into the list with
 JavaScript, leading to duplicating the id attribute again (the original
 form is left where it was). So I think it would require some more
 JavaScript to modify the `id` and `aria-labelledby` attributes before
 inserting the form into the list.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55575>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list