-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline Comments triggering "Confirm Reload" page on beforeunload #42
Comments
I can't seem to replicate this either locally or on cdev. The 'change-tracking' branch has code to prevent this so if it's required on vanilla SP it can easily be ported. |
Weird. I'm now using a different machine, and I'm not seeing the problem. It must be a plugin conflict, or maybe a difference in load order caused by config difference between the two installations. (I'm guessing Inline Comments is loading really late or something.) I'll leave this ticket open, because it may be worth porting the |
I suspect load order too, but can't be sure without finding a way to reliably replicate. |
So, funny thing - on the installation where I'm having the problem, commenting out |
The Inline Comments plugin adds the 'data-incom' attribute to the content. This attribute should never be saved into the database as it interferes with revisions via auto-save and comment positioning. See #42.
I was looking into an issue where FEE was causing unnecessary post revisions being created due to WP autosave and FEE's formatting filters and thought it was semi-related to this issue. The commits that are linked to this ticket strip the extra paragraph elements caused by FEE applying wpautop() to the editor content. This fixes the
I also found this to be the case. When I comment out the |
@christianwach I'm currently getting the behavior on cdev. Any chance you could debug there, and/or have a think about what @r-a-y says above? I think we've got to fix this before we ship. |
@boonebgorges I cannot get any pages to load on cdev - all I get is |
On my local install, the listeners in 807f402 are attached prior to WP FEE's and are therefore able to manipulate the editor content before WP FEE checks it. It'd be nice to strip the attributes from the post content before it's sent to the server during autosaves too. This would avoid the need to pre-filter the post content in e036fd2. However, I can't find an appropriate hook to do so - there's |
Yeah, I couldn't find an appropriate JS trigger, which made me filter the post content on auto-save.
This fixes the "Enable Editing" toggling issue for me. Thanks Christian! |
Fixing it for me too. Thanks, @christianwach ! Let's reopen if it crops up again. |
As per Gitter comments, I'm reopening this because I have noticed that when the |
This seems to be partially solved by 89c3d09 to the extent that the "Cancel" now reinstates the I've noticed that sometimes the editor considers a single delete/backspace key press not significant enough to trigger
This is equivalent to the following HTML once it's rendered: <p>One</p>
<p>Two</p>
<p>Three</p>
<p>Four</p>
<p>Five</p> Hit delete/backspace once with the cursor at the beginning of "Five" to produce "FourFive". For me, when I click "Disable Editing" I sometimes get the "Leave" dialog, sometimes not. Doesn't seem to be consistent, unfortunately. I can force |
206b11e resets comment |
Wanted to make sure that the discussion from #77 (comment) was looped back here - it's possible that rolling back the |
@boonebgorges I'm working on a substitute for |
Instead of comparing content, we set an `isDirty` flag whenever a change is detected. The flag gets set back to `false` on `fee-after-save`. This technique can result in some false positives, as when you change content but then undo that change. But it has a couple of benefits that outweigh this downside: * It warns the user about unsaved changes on the Settings panel, which FEE doesn't know about. * It allows us to modify the content of the editor at will, without worrying about FEE's `isDirty` checks. See #77, #71, #42.
FEE gives a
saveAlert
if you try to leave with a "dirty", unsaved post. Inline Comments changespost_content
to add its markup, which causes FEE'sisDirty()
check always to be tripped once Inline Comments has done its thing - whether a real edit has taken place or not.The text was updated successfully, but these errors were encountered: