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.

[Mentions Plugin] No results showing and onSearchChange not triggering

See original GitHub issue

Hi,

I was able to get this working before but for some reason after doing some slight changes to our custom editor, the mentions menu never shows up now and our onSearchChange method never gets called.

I did some debugging and getAllSearches seem to always return Map {size: 0, ...} so it never calls onSearchChange in MentionSuggestions in the onEditorStateChange method.

It’s been pretty difficult trying to debug what the issue might be. We are bringing in a full tags list, setting it initially as this.state.suggestions and then passing it in, but we just don’t get any results and onSearchChange never fires. We don’t see any errors either so it’s just been hard figuring out what we could be doing incorrectly.

Any thoughts on what could be wrong with our setup or why we can’t seem to get any results?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
hamed-faragcommented, Feb 23, 2017

I will describe my issue and how I fixed it,

Scenario: 1- A Rich Text Editor (RTE) a user can write what he wants and can mention any user at the system. 2- User click on submit button. 3- System reset RTE after submitting How System reset, by the following line EditorState.createEmpty() 4- Mention plugin not working again anymore and onSearchChange not triggering again.

For more than 3 hours investigating, the above line of code reset the editor and also remove any attached plugin. So I change it to the following line of code and everything working fine. EditorState.push(currentState, ContentState.createFromText(''))

3reactions
nikgrafcommented, Feb 27, 2017

I merged yesterday which might fixes the issue. Please let me know if it did after the next release …

Read more comments on GitHub >

github_iconTop Results From Across the Web

z4o4z/draft-js-mention-plugin/CHANGELOG.md - UNPKG
The CDN for @z4o4z/draft-js-mention-plugin. ... inserting the selected item on Enter or Tab when there's no trigger in sight and dropdown is not...
Read more >
Mention - DraftJS Plugins - High quality plugins with great UX
onSearchChange A callback which is triggered whenever the search term changes. ... to true if will render the popup even if there are...
Read more >
How to enable user tagging and Mentions in your app
Wondering how to tag someone in TinyMCE? This tutorial shows you how to implement user tagging with the Mentions plugin in TinyMCE.
Read more >
Using Draft js mention plugin with react hooks - Stack Overflow
The onSearchChange method will be triggered once the '@' character is typed, so in this case it will return just 5 items that...
Read more >
How to use the draft-js-mention-plugin function in draft ... - Snyk
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
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