Skip to content

Instantly share code, notes, and snippets.

View varunajmera0's full-sized avatar
🙄
funny

AV varunajmera0

🙄
funny
View GitHub Profile
@varunajmera0
varunajmera0 / draftjs-hashtag-plugin-modified.js
Last active July 31, 2019 11:38
I was trying to create entity when # appears but when you remove/delete multiple selected text it is not working properly.
//https://stackoverflow.com/a/49214278
//https://github.com/facebook/draft-js/issues/506#issuecomment-230123013 #for word find
import decorateComponentWithProps from 'decorate-component-with-props';
import Hashtag from './Hashtag/index';
import hashtagStrategy from './hashtagStrategy';
import styles from './styles.css';
import {
EditorState, SelectionState, Modifier, getDefaultKeyBinding, KeyBindingUtil, genKey, ContentBlock, ContentState,
} from 'draft-js';
import {extractHashtagsWithIndices} from "./utils";