3 ms·
I made a rich text editor in 2004 and last year I made another one, and nothing has changed. The most annoying thing is that contentEditable works different in
by z3t4 8y ago
I made a rich text editor in 2004 and last year I made another one, and nothing has changed. The most annoying thing is that contentEditable works different in different Browsers. Some browsers for example use <div> instead of <p>. And browsers will add extra HTML elements! If you for example pass in <table> the contentEditable will add a <thead> element, so you constantly have to check what the contentEditable is up to. It would probably be easier to use HTML Canvas and implement everything from scratch.
- nkozyra 8y agoIsn't this why a bunch of wysiwg editors eschew contenteditable in the first place?
- evangow 8y agoYou might be interested in the video linked below on how DraftJS (which was the forerunner of SlateJS) uses the virtual DOM created by React along with contentEditable to make the same tooling work across browsers. https://www.youtube.com/watch?v=feUYwoLhE_4 https://www.youtube.com/watch?v=feUYwoLhE_4