I'm working on a personal app that requires a rich text editor, for which I'm using DraftJS and plugins. In addition to be able to @mention people (which provides that nice typeahead experience), I also want to do the same for #hashtags and additional entities like $documents or something.
I noticed that the documentation says that the trigger character is configurable, but it did not have an option for providing multiple trigger characters. I considered creating multiple instances of the plugin, but that sounded like a recipe for chaos. I decided to try looking the code itself, to see if it would be easy to modify the internals of the plugin from my application, but that didn't work out either. By this point, I accidentally understood what was going on, so just ended up making the actual change.
Right when I was about to make a PR, the instructions told me to create an issue here, so I'm doing that now.
may be you can try this
const hashtagPlugin = createMentionPlugin({
mentionPrefix: '',
mentionTrigger: '# , $ , %, & or what the character you want',
entityMutability: 'IMMUTABLE',
});
const plugin = {[hashtagPlugin]}
@farmer911 : I don't think that solves the problem.
I want multiple characters that can trigger the typeahead.
My PR #1419 solves this problem properly, and I'm already using that fork in my project.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
@farmer911 : I don't think that solves the problem.
I want multiple characters that can trigger the typeahead.
My PR #1419 solves this problem properly, and I'm already using that fork in my project.