7 ms·
I'm surprised to see no mention of the Trix editor here amongst the comments about how contentEditable is the root of all evil. Trix has a nice solution, from t
by codebeaker 9y ago
I'm surprised to see no mention of the Trix editor here amongst the comments about how contentEditable is the root of all evil. Trix has a nice solution, from their readme:
Trix sidesteps these inconsistencies by
treating contenteditable as an I/O devi-
ice: when input makes its way to the ed-
itor, Trix converts that input into an
editing operation on its internal docum-
ent model, then re-renders that document
back into the editor. This gives Trix
complete control over what happens after
every keystroke, and avoids the need to
use execCommand at all.
Trix is from basecamp, and has a super healthy plugin/extension ecosystem - https://github.com/basecamp/trix https://github.com/basecamp/trix
Full disclosure: not affiliated at all, but the rare times I need a WYSIWYG editor I tend to look for Trix and be very pleased.