[wp-trac] [WordPress Trac] #40056: Shift-click to select a range of checkboxes isn't working anymore since 4.7.3 update

WordPress Trac noreply at wordpress.org
Fri Mar 10 18:53:49 UTC 2017


#40056: Shift-click to select a range of checkboxes isn't working anymore since
4.7.3 update
----------------------------+-----------------------------
 Reporter:  ZehrGut         |       Owner:  afercia
     Type:  defect (bug)    |      Status:  assigned
 Priority:  normal          |   Milestone:  4.7.4
Component:  Administration  |     Version:  4.7.3
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:  ui, javascript
----------------------------+-----------------------------
Changes (by afercia):

 * keywords:  needs-patch => has-patch


Comment:

 So, before [38703] the original selector was:
 `$('tbody').children().children('.check-column').find(':checkbox').click(
 function(e) {`

 Because of #37973 this event needs to be delegated, and the selector was
 changed in [38703], then amended in [38706]:
 `$body.on( 'click', 'tbody .check-column :checkbox', function( event ) {`

 However, to support the edge case of nested tables (see #39739), it was
 changed again in [40118]:
 `$body.on( 'click', 'tbody > .check-column :checkbox', function( event )
 {`

 The selector above doesn't actually select anything... instead it should
 be:
 `$body.on( 'click', 'tbody > tr > .check-column :checkbox', function(
 event ) {`

 which, starting from `tbody`, selects the children `tr` then the children
 `.check-column` and then all the `:checkbox` and should finally be
 equivalent to the original selector.

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


More information about the wp-trac mailing list