Welcome to Codidact Meta!
Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.
Editor preview left outdated after adding content without the keyboard
Generally when making a change in the input text box for a post, the editor preview updates to reflect the change. However, there are two occasions when this is not the case, and the editor preview is left outdated and inconsistent with the input text box.
Pasting in text
After pasting in text to the input text box, the editor preview does not show the new text until a keyboard interaction is made (adding or removing a character, or moving the keyboard cursor). Note this problem does not occur if the pasting is done with a keyboard shortcut, such as ctrl + V. The problem only occurs when the keyboard is not involved, such as when using the mouse to paste.
Uploading an image
After uploading an image, the Markdown for the image is automatically included in the input text box, but the editor preview does not include the image until next time the cursor is moved into the input text box (that is, next time the input text box becomes active).
This can be particularly confusing when the editor preview already contains an image added previously, since at first glance it can look like the wrong image has been added.
Effect on saved post
This can also lead to an image being confusingly missing from the saved post, if it has not been added to the preview and then the "Save Post" button is pressed. This is the reason for the second example given in Post body does not render outside of preview.
Examples:
Workarounds
Missing text or image in the editor preview
Click anywhere in the "Body" field to return the keyboard cursor there, and the preview will update.
Missing image after a post has been saved
Press "Edit", then press "Save" without making any changes. The image will now be present in the saved post (it was already present in the Markdown). You don't need to avoid making changes - this will work whether you make changes or not.
Note that if you always add alt text to images in your posts, then you will never see this problem, as it only happens when adding an image is the last action you take before pressing "Save Post".
0 comment threads