It’s certainly a side effect of replacing the text, but it’s also not so nice for the user. I think we could save the cursor position before we replace the text and restore it thereafter.
Just tried it out a couple of times and all I could reproduce is that, if I type very fast, one character is omitted. Is this what you refer to as “weird stuff”?
I would say though that these are two phenomena that add up and getting rid of each of them is desirable, or isn’t it?
So the upload placeholder replacement is triggered in composer-editor.js.es6here (on cancel) and here (on success) and handled by d-editor.js.es6here or here respectively: