Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#39098 closed defect (bug) (fixed)

Customize: Clicking on child elements of preview links fails to abort navigation to non-previewable links

Reported by: westonruter's profile westonruter Owned by: westonruter's profile westonruter
Milestone: 4.7.1 Priority: normal
Severity: normal Version:
Component: Customize Keywords: has-patch commit fixed-major
Focuses: Cc:

Description

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:

- link = $( event.target );
+ link = $( event.target ).closest( 'a' );

Attachments (1)

39098.0.diff (495 bytes) - added by westonruter 8 years ago.

Download all attachments as: .zip

Change History (11)

@westonruter
8 years ago

#1 @westonruter
8 years ago

  • Keywords has-patch needs-testing added

This ticket was mentioned in Slack in #core by helen. View the logs.


8 years ago

#3 @westonruter
8 years ago

  • Milestone changed from 4.7 to 4.7.1

#4 @westonruter
8 years ago

  • Owner set to westonruter
  • Status changed from new to accepted

This ticket was mentioned in Slack in #core-customize by celloexpressions. View the logs.


8 years ago

#6 @curdin
8 years ago

Patch applies cleanly and works as expected. Latest Chrome and Safari macOS.

Last edited 8 years ago by curdin (previous) (diff)

#7 @westonruter
8 years ago

  • Keywords commit added; needs-testing removed

#8 @westonruter
8 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 39584:

Customize: Prevent navigation in preview when clicking on child elements of preview links that have non-previewable URLs.

Fixes #39098.

#9 @westonruter
8 years ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 4.7.1.

#10 @dd32
8 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 39585:

Customize: Prevent navigation in preview when clicking on child elements of preview links that have non-previewable URLs.

Props westonruter.
Merges [39584] to the 4.7 branch.
Fixes #39098.

Note: See TracTickets for help on using tickets.