-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
Autosave causing the 'do you want to leave' nag on new posts #4400
Comments
@ErisDS Yesterday when I was delving into Ghost for the first time I noticed a couple of funny behaviors in regards to the Ghost modal ‘do you want to leave’. Maybe this will help you guys in debugging...
The ‘Stay’ button works as expected in Draft and Publish modes. Tech Specs:Mac Yosemite v10.10 |
This is intentional, otherwise your changes would be pushed to the frontend before you were ready |
P.S. @brandon-vanha Thanks for the further details ;) Your first note about leave saving is interesting. I think we could reduce the number of cases in which there is a modal displayed by using The browser-based model is there to prevent tab-closes etc, so we'd still need that, but clearly it's getting triggered incorrectly. I'm not sure if this is to do with our model of whether there's something to save being wrong, or if it is something to do with the transition from new->edit routes being handled incorrectly, or if it's a combination of the two. @novaugust pinging you on this as it's vaguely related to #4321 |
Hmm hmm, yeah, I've been playing around with getting that "Save before you go" to not show up just because of a default title (https://github.com/TryGhost/Ghost/pull/4387/files#diff-d97d5643b05afae9b3c5a9a041684c0bR102) I'm very interested to see if I can reproduce the "leaving a draft saves" thing though. |
I can reproduce this bug on a live Ghost.org blog, but not locally so, it's either recently been unintentionally fixed, or it's environmental. I have been able to reproduce it in Google Chrome, Safari, and Firefox. Let me know if you need any more details to reproduce this. Steps to reproduce:
Demonstration:More information
Technical details:Online Ghost Version: 0.5.3 |
@joeldrapper That doesn't look like a bug, that looks like how it's suppose to work =) If you've typed stuff in and try to leave, it's going to warn you that you're losing your changes. |
@novaugust I believe he's not trying to leave but just typing and waiting for the first autosave to fire I think? The problem is that the first autosave is triggering the URL update, and this seems to be triggering a modal, even though it shouldn't be because we should be 'isSaving' |
Clearly, I'm out of my element here Walter. On Tue, Nov 11, 2014 at 3:21 PM, Hannah Wolfe notifications@github.com
|
@ErisDS that's right, it appears before I try to leave. You should be able to reproduce it on a Ghost.org blog in any browser. Let me know if you need more details. I've updated the steps to reproduce to make it more clear. |
Yeah, I reproduced it no problem :) Sorry for the confusion |
Should be able to get on this this weekend and have it ready for the release.. |
@novaugust awesome 👍 |
I've figured out what's happening here, and it's a latency issue. To reproduce it locally, just use chrome's dev throttle.
We'd never see it in development, where local requests happen faster than we can type a single character. It should be possible to make the "dirty transition" bit somewhat smarter - the "willTransition" event needs to just check if the transition is going to |
Closes TryGhost#4400 - Added focusCursorAtEnd property to codemirror component, to set the cursor at document end on load. Used for posts that have been edited - centralized codemirror init code in component
So, I've tested out this issue on master. I could not get it to happen on windows chrome, but on mac (yosemite) chrome it happened first time! Good shout on the timing issue 👍 |
This has been reported as happening in Mac OS Chrome via twitter: https://twitter.com/webalys/status/529882514760818688
I have not been able to reproduce it, but my Mac is not yet on Yosemite. User has confirmed it's only happening on new posts.
It's not yet clear whether the alert is the browser one:
or our modal:
But I'd guess the browser one.
On a slight tangent, but possibly related if it is the browser one, I've seen reports of it firing when focusing from the title to the main editor on some more obscure browsers (which makes sense but shouldn't be happening) and in IE I've repeatedly seen the message which is supposed to display, appear as 'null'.
Having worked with
window.onbeforeunload
before, I seem to remember it works slightly differently in different browsers and is quite sensitive to subtle things like whether the return value is empty,null
orundefined
.Steps to reproduce
Technical Details
Browser: Chrome (does not happen on FF)
OS: Mac OSX
Possibly related:
https://code.google.com/p/chromium/issues/detail?id=341476
The text was updated successfully, but these errors were encountered: