Mention Plugin - Problem with mentionTrigger
See original GitHub issueWhen I make the mentionTrigger
a parenthesis (
or bracket [
, like this:
const mentionPlugin = createMentionPlugin({
mentionTrigger: '(',
});
I get this error:
Uncaught SyntaxError: Invalid regular expression: /(/: Unterminated group
at RegExp (<anonymous>)
This only happens if the first thing that I type into the editor is (
. If I type some other characters first, it works fine.
Is there a way to achieve the same thing with mentionRegExp
?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[draftjs-mention-plugin] MentionSuggestions popover is not ...
Hi Guys, I am getting an issue with MentionSuggestions Popover. ... triggering immediately after mentionTrigger until some text is added.
Read more >How to use the draft-js-mention-plugin function in draft ... - Snyk
To help you get started, we've selected a few draft-js-mention-plugin examples, based on popular ways it is used in public projects.
Read more >z4o4z/draft-js-mention-plugin/CHANGELOG.md - UNPKG
The CDN for @z4o4z/draft-js-mention-plugin. ... 31, - Fixed replace issue while `mentionTrigger` is empty. 32. 33, ## 3.1.2.
Read more >draftjs - Draft.js Mention Plugin is not working after rendering ...
You should do the following: const [editorState, setEditorState] = React.useState(() => { const parsedData = JSON.parse(post.
Read more >Mention - DraftJS Plugins - High quality plugins with great UX
import '@draft-js-plugins/mention/lib/plugin.css'; ... mentionTriggerAllows you to provide a array custom character to change when the search is triggered.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@agarrharr ugh - fixed now, that plugin really needs a rewrite and some tests!
The fix will be live shortly as
draft-js-mention-plugin@2.0.0-rc10
It works great now!