[wp-trac] [WordPress Trac] #42475: Customize: Autosaving message not sent to preview at first change

WordPress Trac noreply at wordpress.org
Wed Nov 8 20:21:30 UTC 2017


#42475: Customize: Autosaving message not sent to preview at first change
--------------------------+-----------------
 Reporter:  westonruter   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  4.9
Component:  Customize     |    Version:  4.9
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------
 In `customize-controls.js` there is a `startAutosaving` function that gets
 called once a change is first made. It then in turn will start listening
 for changes to the `saved` state to then send an `autosaving` message to
 the preview when it goes dirty. However, the `saved` state also gets set
 to `false` (dirty) when a `change` event happens. This means that the
 `saved` state change handler is not getting fired with the first change.

 Easy way to see this behavior is to install the customizer-dev-tools
 plugin and run this from the console:

 {{{
 CustomizerDevTools.startLogging(/autosaving|saved|change/)
 }}}

 You'll see the `autosaving` message is not sent to the preview after the
 first change, but it will be sent after saving a draft and making a second
 change.

 Likewise, you can see the problem illustrated by hovering over links in
 the preview after the first change and see they lack the
 `customize_autosaved=on` parameter. However, after saving a draft and
 making a second change, then you'll see the param appear.

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


More information about the wp-trac mailing list