WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 7 months 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 Owned by: 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 months ago.

Download all attachments as: .zip

Change History (11)

@westonruter
8 months ago

#1 @westonruter
8 months ago

  • Keywords has-patch needs-testing added

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


8 months ago

#3 @westonruter
8 months ago

  • Milestone changed from 4.7 to 4.7.1

#4 @westonruter
8 months 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 months ago

#6 @curdin
7 months ago

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

Last edited 7 months ago by curdin (previous) (diff)

#7 @westonruter
7 months ago

  • Keywords commit added; needs-testing removed

#8 @westonruter
7 months 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
7 months ago

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

Reopening for 4.7.1.

#10 @dd32
7 months 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.