question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mention Plugin - Problem with mentionTrigger

See original GitHub issue

When 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:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
juliankrispelcommented, Sep 26, 2017

@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

0reactions
agarrharrcommented, Sep 27, 2017

It works great now!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found