Make WordPress Core

Opened 7 years ago

Last modified 3 years ago

#39475 new defect (bug)

Customize doesn't consider the hash in the URL after change

Reported by: edpittol's profile edpittol Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.4
Component: Customize Keywords: needs-patch
Focuses: javascript Cc:


When I open a page that has a hash in the URL, in the Customize, the behavior wasn't the expected. At least for me. The preview Iframe is loaded in the first time with the hash. But after a setting update, using the refresh transport, the hash disappear.

Customizer URL

First preview Iframe href

Second preview Iframe href (after a change)

I debugged the customize JS scripts and saw that in the line 796 of the wp-includes/js/customize-preview.js file is set the frame URL. It come from api.settings.url.self value. I cannot identify where this value is the.

In a quick test, I concatenated the hash with the URL and the second Iframe was loaded with it.

Change History (3)

#1 @westonruter
7 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Version changed from 4.7 to 3.4

@edpittol yes, improvements are needed to how page anchors aka URL hash fragments are handled in the customizer preview. Another case which isn't handled as expected right now is a link from one page to another with a fragment supplied. This won't scroll to the page anchor as expected.

I think this is a longstanding behavior with the customizer preview behavior and isn't anything new.

#2 @westonruter
7 years ago

  • Keywords needs-patch added

#3 @celloexpressions
3 years ago

While low priority, this would be a nice thing to fix since users might want to test page anchor links in nav menus, widgets, or content areas with live preview in the customizer.

Note: See TracTickets for help on using tickets.