When editing text in the new markdown editor, the cursor can be off by a line (or few?). This seems to happen reliably, but exact cause is not narrowed down yet. Seems to only be when editing existing content, not when creating new content (even pasting the exact same text). I think it has to do with the initial height of the input area being tall. Sometimes I can get the cursor to work properly again if I add or delete enough rows to make the textarea resize some amount.
I've narrowed down the bug, but still have no idea how to fix it :(
The bug is caused by SimpleMDE itself or by 'gfm' (markdown) mode of CodeMirror when
lineWrapping
is enabled and you have particular pattern of lines and actions. I.e. first line is exactly as long as the editor, so typing next symbol will wrap the line, and the second one is longer, so it is wrapped already. Plus, you must have some long text before and after it.Plain CodeMirror does not have it and I was not able to create a jsfiddle with CodeMirror + 'gfm' mode yet (see github issue below).
Opened an issue for SimpleMDE https://github.com/NextStepWebs/simplemde-markdown-editor/issues/39
Maybe someone will shed a light on it...
The maintainer of SimpleMDE has closed the issue on github https://github.com/NextStepWebs/simplemde-markdown-editor/issues/39#issuecomment-129041733
I didn't check it for myself yet, though
Closed #835.
ib/7948
Updated SimpleMDE to 1.5.0 and it fixes the issue for me.
Full screen mode has been added in this version. I've changed some css for it to work and it works fine on the ticket edit for example, but it it doesn't currently work for comments due to this bug.
We can disable full screen until it fixed or just wait a bit, seems like SimpleMDE's maintainer reacts pretty quickly :)
I guess we can wait a bit, since the issue is already fixed, and 1.5.1 will be released soon
Yeah 1.5.1 is out now, want to update to that before we close out this ticket?
Updated to 1.5.1.
There's one problem, though. If artifact has a few of comments/replies and you're trying to edit one of them in full screen mode, some of them will overlap the editor, ignoring it's (higher) z-index.
Basically, the problem is that each comment's "div.row" creates new stacking context by using:
The editors are inside these contexts, it means that editors in stacking contexts closer to the bottom of the stacking order can't appear in front of an element in a different stacking context that is higher in the stacking order, no matter what
z-index
is used. This article really helps in understanding that.The reason we have
z-index
for each comment is that our top-level comments have darker border color than replies, so we need to put replies to the bottom of stacking order, so that top border wouldn't overlap with a parent comment's bottom border.If we're feeling fine making border color of the replies the same as top-level comment's, then we can fix the issue (see commit
615d4d0
). If not we're better off disabling full screen mode I think.I've tried to keep colors as is and fix border overlap without using z-index, e.g. setting
border-top-color: transparent;
for replies but it looks bad.I think I got it to work. What do you think of [9873e2] on db/7948?
And another commit on db/7948 to make fullscreen not have a max-height
Nice fix Dave! Looks good to me