[wp-trac] [WordPress Trac] #57344: Gutenberg Block Editor Specifies Incorrect ID on Label

WordPress Trac noreply at wordpress.org
Fri Dec 16 20:55:02 UTC 2022


#57344: Gutenberg Block Editor Specifies Incorrect ID on Label
--------------------------+-----------------------------
 Reporter:  gsexton       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  6.1.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 **Overview**

 I noticed that on the edit page, when editing a page that has my block
 embedded, clicking on the label for a block control did not check/uncheck
 the associated checkbox.

 The control is defined as:


 {{{
 el(
     wp.components.CheckboxControl,
     {
         id: 'cd-rcalendar-wrap',
         checked: props.attributes.wrap_events,
         label:
 i18n.__('COM_CONNECTDAILY_WRAPTITLES',CDaily.CAPTION_BUNDLE),
         onChange: function( value ){ setAttributes({wrap_events: value});}
     }
 )
 }}}

 The rendered HTML code is:


 {{{
 <span class="components-checkbox-control__input-container">
 <input id="cd-rcalendar-wrap" class="components-checkbox-control__input"
 type="checkbox" value="1">
 </span>
 <label class="components-checkbox-control__label" for="inspector-checkbox-
 control-5">Wrap Event Titles</label>
 }}}

 You can see the for clause of the label is not the id specified in the
 control definition.

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


More information about the wp-trac mailing list