Skip to content

adding mentionTrigger #320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 9, 2016
Merged

adding mentionTrigger #320

merged 5 commits into from
Jul 9, 2016

Conversation

YoonjiJang
Copy link
Contributor

@YoonjiJang YoonjiJang commented Jun 21, 2016

Addresses #253 (comment).

Adds mentionTrigger to config with default value of @.
Adds and searches for mention entities with key of 'mention' + mentionTrigger
mentionStrategy and mentionSuggestionsStrategy takes the trigger as a parameter.

Feedback welcome

@nikgraf nikgraf added the 2.0 label Jun 26, 2016
mentionSuggestions: mentionSuggestionsStyles.mentionSuggestions,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spaces where here by intention to make it easy to distinct which component is affected. Maybe a comment would have been better. Can you add comments?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize I made these changes. I'll add some comments.

@nikgraf nikgraf merged commit 358d630 into draft-js-plugins:master Jul 9, 2016
@@ -1,9 +1,8 @@
/* @flow */

import findWithRegex from 'find-with-regex';
import _ from 'lodash';
Copy link
Member

@nikgraf nikgraf Jul 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not ideal, as it would include the whole lodash library. By using import escapeRegExp from 'lodash/escapeRegExp' we can reduce the imported code and skip all other lodash code not necessary for this plugin.

@nikgraf
Copy link
Member

nikgraf commented Jul 9, 2016

Some related improvements here #344

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants