-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Editor: Switching between Visual/HTML editors marks page as dirty, gives double prompt #6869
Comments
The second prompt (step 4) should now be resolved as of #6872, but the issue remains that the editor incorrectly flags a post as being dirty after merely switching editing modes. |
After some debugging, the main culprits here are:
The solution here is to devise a consistent format for each. If we want unencoded characters to be reflected in an updated post, we ought to decode characters from the saved post when initially loading the editor. Similarly, if we want to use |
This is also related to how we manage content in the editor. Because we decided early on that TinyMCE's Because in the HTML view we do not show or want to show paragraph tags, we need to make sure that raw content is reset in such a way that it is compatible with the textarea value. In early development, we did so by resetting the raw content when switching to the HTML mode (10420-gh-calypso-pre-oss). Upon closer inspection, I found that I had mistakenly removed this in #5438, likely because the placeholder actions being removed included one of the same name (
Note that while initial raw content and raw content are initially set as the same with an encoded wp-calypso/client/components/tinymce/index.jsx Lines 432 to 436 in dfd99ea
It seems we'll want one or both of the following:
The second of these is more interesting. Since the whole purpose of raw content relates to TinyMCE content getters, it seems strange that we try to maintain the value using the textarea value, when we could instead set content directly into the post. Of course, this would mean we'd have to reset raw content back again from post content if the user then switches back to the Visual editor. |
The In wp-admin, the HTML tab's content will always show with encoded value. Since #8325 in Calypso this is not the case. It's arguable which would be preferable, but it's worth pointing out that the value for a So we can have encoded values with
Or we can have decoded values:
|
Confirming this is still an issue #bug-scrub #pre-gutenburg-bug-purge |
@hoverduck @aduth @alisterscott Can one of you un-assign me from this issue please? |
Huh, never mind, it looks like GitHub decided to do it for me when I commented. Thanks anyway! |
I am closing this as the classic editor in calypso is being deprecated in favor of the block editor. If needed, please feel free to reopen. |
Steps to reproduce
What I expected
To be able to move around without issue
What happened instead
I was prompted with an alert saying I had unsaved changes when leaving the editor. That's not ideal, but maybe not a problem. What concerns me more is that I was prompted again when navigating elsewhere in Calypso (on Chrome only, Firefox didn't show that problem). Possibly related to #6859 from earlier today? cc: @nylen
Browser / OS version
Chrome v51 on OSX and Windows 10
Firefox v46 OSX
Screenshot / Video
Context / Source
manual-testing
The text was updated successfully, but these errors were encountered: