[wp-trac] [WordPress Trac] #39797: Customizer Preview JS Object triggers preview pane refresh on javascript behavior

WordPress Trac noreply at wordpress.org
Mon Feb 6 15:37:00 UTC 2017


#39797: Customizer Preview JS Object triggers preview pane refresh on javascript
behavior
---------------------------+-----------------------------
 Reporter:  brianjfleming  |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Customize      |    Version:  4.7.1
 Severity:  normal         |   Keywords:
  Focuses:  javascript     |
---------------------------+-----------------------------
 When rendering anchor tags in customizer, the customize-preview.js object
 injects customizer states into the href attributes of those links as
 follows. These seem to help affect the pane-refresh and customizer
 behavior within the preview pane.


 {{{
 <a href="https:/mywebsite.com/some-page-
 permalink/?customize_changeset_uuid=5b88a13f-e309-4c1d-
 9c30-6e1acdf46912&customize_messenger_channel=preview-0">
 }}}


 When the href attribute value is a standard anchor hash, the preview
 object appends nothing as the link does not need to have any sort of
 special behavior so-to-speak within the customizer preview pane.


 {{{
 <a href="#">
 }}}


 However, anchor tag hash behavior will dictate a jump to the top of the
 page which is often avoided in using a javascript: void(0); or similar
 href value, which customizer is hooking as a valid reference url and
 clicking that triggers a page refresh, which seems like unintended
 behavior.


 {{{
 <a href="javascript: void(0);?customize_changeset_uuid=5b88a13f-e309-4c1d-
 9c30-6e1acdf46912&customize_messenger_channel=preview-0">
 }}}

 Have also tried with href values of the following with the same results:

 {{{
 href="javascript:;"
 href="javascript: return false;"
 }}}

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


More information about the wp-trac mailing list