[wp-trac] [WordPress Trac] #39098: Customize: Clicking on child elements of preview links fails to abort navigation to non-previewable links

WordPress Trac noreply at wordpress.org
Tue Dec 6 03:05:53 UTC 2016


#39098: Customize: Clicking on child elements of preview links fails to abort
navigation to non-previewable links
--------------------------+-----------------
 Reporter:  westonruter   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  4.7
Component:  Customize     |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------
 In Twenty Seventeen, the social links nav menu has SVG elements as
 children of the nav menu item links. The `handleLinkClick` function that
 handles delegated clicks on `a` elements is currently checking if the
 `event.target` lacks an `href` attribute and if so, it short-circuits
 since it's not a link. But if the user clicks on a child element, then the
 `event.target` is not actually the `a` element but the clicked element.
 The logic for getting the link element needs to change as follows:

 {{{#!diff
 - link = $( event.target );
 + link = $( event.target ).closest( 'a' );
 }}}

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


More information about the wp-trac mailing list