Using the editor toolbar in e.g. Chrome has unintended effects:
If you try to undo the changes done to your text with Ctrl + Z, this will not work. Instead the last change done before using the toolbar button will be undone, leaving the changes from the toolbar buttons in place. Unquoting, unstyling, unpreformat a paragraph can be very cumbersome.
A previous discussion was closed to avoid bikeshedding, but as I
don’t agree want to get this fixed I asked for clarification and was told to open a new topic. Here we go:
I think the current, unwanted bahaviour, is caused by the direct setting of
document.execCommand('insertText', ...) better.
Research on this is here:
Wouldn’t it make sense to implement a
setValue() and differentiate between browser there?
Next steps on this would include:
- Map the current state of functionality (state right now: Firefox works, Chrome doesn’t - what about Safari, Opera, etc?)
- Which browser are officially supported by Discourse?
- Are there other files involved in this functionality that I didn’t find?
- Maybe look into how other editors handle this functionality - this has to have been implemented a dozen times already.