Draft.js: how to remove formatting of the text
▻https://hackernoon.com/draft-js-how-to-remove-formatting-of-the-text-cd191866d9ad?source=rss---
Photo by Natalia Y on UnsplashOne of the features that we at Propeller miss in Draft.js out-of-the-box is the possibility to clear the stylings of selected text, leaving plain text inside the editor. We believe this behaviour is commonly used and our user may expect this feature to be on it’s place. As always in order to add this feature you would need to spend significant amount of time digging into Draft.js documentation in order to find required information.This post describes what steps you should take in order to add this behaviour into your project.All editing in Draft.js may be divided into 3 groups:Inline stylesCustom entities(for example images, links etc.)Block typesIn order to clean the text up we need to take care of all of these groups.Inline StylesThis one is pretty simple. (...)
#javascript #draftjs #react #front-end-development #web-development