DEV Community

loading...

Discussion on: Is document.execCommand() obsolete?

supunkavinda profile image
Supun Kavinda Author

Thanks for the comment, David.

After posting this, I checked Medium's source code and it seems like they are not using execCommand.

There are undo options in draft.js. Wanna try it as the project is already written in React.

Thanks for the thoughts!

Thread Thread
nsharma1396 profile image
Neeraj Sharma

Hey, draft.js is an exceptional rich text editor framework in my view. But I can say that it lacked detailed documentation when I used it which made it harder to find solutions for simpler problems. You can also consider Slate.js which shares a lot of similarities with Draft.js. I personally used Draft.js and can say that it was quite good too.

Thread Thread
supunkavinda profile image
Supun Kavinda Author

Neeraj,

Thanks for the comment. We started creating the app with draft.js and it's pretty amazing. Yes, the documentation isn't very good. I cloned the medium-draft repo and learned how he has used draft JS and then started coding. That's easier than going through the documentation ;) Never knew about slate.js. Will check that out.

Thanks.

Thread Thread
nsharma1396 profile image
Neeraj Sharma

Glad to know that! All the best with draft. If you haven't already, I would also recommend you to check out Draft.js Plugins. Excellent package covering lots of interesting use cases like mention/suggestion box, etc., created by Nik Graf.

Thread Thread
daviddalbusco profile image
David Dal Busco • Edited

So, I have re-implemented our WYSIWYG component to replace the obsolete document.execCommand

I just published a blog post to introduce the solution.

Any feedback or contributions are more than welcomed!