Use decorator with `findWithRegex` strategy along with `entityMap`
See original GitHub issueDo you want to request a feature or report a bug? question
I’m struggling to understand the right way to use decorators in my use case.
I want to decorate/annotate a list of words that match a set of rules/regexs and allow the user to ignore certain words, so that they are not being highlighted anymore.
The idea of the ignore feature goes like this: I want to allow the user to ignore certain matches. For this I added a tooltip above the highlighted word. The issue is, if I just add a filter to ignore this specific regex, all the matches are ignored and I don’t want this. I want to ignore only this specific occurrence.
My idea was to get the entities from the entityMap
and store the key in a ignore
data structure. Now since I use the findWithRegex
approach my entities and not really distinguishable since they are not listed in the entityMap
.
Can you guys help me with it?
Any help would be highly appreciated. I’ve looked at the example (https://github.com/facebook/draft-js/blob/master/examples/draft-0-10-0/entity/entity.html) and read the docs (https://draftjs.org/docs/advanced-topics-decorators.html#content) and still don’t know what’s the best way of going about it.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (6 by maintainers)
Top GitHub Comments
Let me know if you have any questions.
Hey @roundrobin I know you posted this message a long time ago, but if by any chance you still have a snippet of a working solution that would help us very much 🙏 We are trying to do exactly the same feature but have not found how yet