[wp-trac] [WordPress Trac] #16972: Input type radio losts its checked focus when metabox is dragged

WordPress Trac noreply at wordpress.org
Sun Dec 6 21:32:17 UTC 2015


#16972: Input type radio losts its checked focus when metabox is dragged
-------------------------------------------------+-------------------------
 Reporter:  depi                                 |       Owner:  azaozz
     Type:  defect (bug)                         |      Status:  reviewing
 Priority:  normal                               |   Milestone:  Future
Component:  Administration                       |  Release
 Severity:  normal                               |     Version:  3.0
 Keywords:  has-patch needs-testing 2nd-opinion  |  Resolution:
                                                 |     Focuses:  javascript
-------------------------------------------------+-------------------------

Comment (by mdawaffe):

 attachment:16972.5.diff uses a different approach.

 The problem with the clone (current code: `helper: 'clone'`) is that it is
 inserted into the DOM alongside the original.  Since only one radio in a
 set of radios with the same name can be checked, the clone's copy of the
 checked radio is checked and the original's becomes unchecked.  When the
 clone is removed after the resorting is done, we're left with no checked
 radios.

 The problem with using the original directly (attachment:16972.4.diff) is,
 as @lessbloat found out, we run into click and other event handlers.

 attachment:16972.5.diff uses a clone, but renames the clone's input
 element names before the clone is inserted into the DOM.  That way, there
 are never any duplicate radios, so nothing gets unchecked.

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


More information about the wp-trac mailing list