[wp-trac] [WordPress Trac] #27657: Clicking 'Publish' before autosave fires does not publish a post
WordPress Trac
noreply at wordpress.org
Fri Apr 4 11:17:27 UTC 2014
#27657: Clicking 'Publish' before autosave fires does not publish a post
--------------------------+-------------------------
Reporter: jeremyfelt | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.9
Component: Autosave | Version: trunk
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: javascript
--------------------------+-------------------------
Comment (by Nessworthy):
Added a small patch to hopefully fix this.
So, the blur event from [trac:source:trunk\wp-admin\js\post.js#506 wp-
admin\js\post.js] triggers an autosave when the `#title` input field is
blurred. For some reason, if this autosave is triggered, submitting /
publishing the post will not be triggered. Instead, the save trigger just
seems to get ignored.
Adding a small timeout of 100ms to the blur event seems to have fixed the
issue on minor testing, but I'm not 100% on what the impact of adding a
timeout may be.
Testing the event by adding a title then causing the `#title` input field
to lose focus still triggers an intended autosave, just 100ms later.
I presume @davidmarichal's attempt to remove the `blur` event for `#title`
was to prevent the autosave from occurring, but the `blur` event will
typically be triggered before the publish button is clicked
([http://jsfiddle.net/gVd5J/1/ jsFiddle]).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27657#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list