Skip to content
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

How can we filter out the manually entered string if it matches the regex and do not show it as a tag. eg: **@[ What is going on]( hello )** #70

Open
shaheer2020 opened this issue Sep 1, 2021 · 5 comments
Labels
enhancement New feature or request v3 Feature and fixes for the major v3 release

Comments

@shaheer2020
Copy link

shaheer2020 commented Sep 1, 2021

The MentionInput currently formats the selected tag items as @Selected_Tag. And in the actual text value it will be provides as @ [ Selected_Tag](TagID) from the data model. But the issue I face here is it will follow the same thing when user enter a text as follows: @ [ What is going on]( hello ) This will get formatted as @what is going on and will be shown to the user as a tag.
@dabakovich Is there anyway that we can escape this user entered string which matches the regex (style it like the normal text, so it does not look like a tag) and consider only the actual tags to look as tags.

@farazirfan47
Copy link

I am looking for the same solution, @shaheer2020 did you figure this out?

@hirbod
Copy link

hirbod commented Jan 6, 2022

I was asking myself the same question today. @dabakovich are you still maintaining this library?

@dabakovich
Copy link
Owner

Thanks for your feedbacks. For now, unfortunately, we can't avoid this. The core concept of the library is to store the whole value as plain text, not as an array of parts. However, in the future (likely in the next v3 release), you will be able to provide your custom mention pattern that could be more complex.

@dabakovich dabakovich added enhancement New feature or request v3 Feature and fixes for the major v3 release labels May 14, 2022
dabakovich added a commit that referenced this issue May 16, 2022
@dabakovich
Copy link
Owner

Hi all.

I'm glad to say that v3 release is coming with few core improvements. One of the new features is full support of multiple characters trigger and custom regex pattern for mentions.

You can find examples of using new v3 release here: https://github.com/dabakovich/react-native-controlled-mentions/blob/3.0/example/mentions-functional-component.tsx

To test alpha pre-release please, install the library using next command:

yarn add react-native-controlled-mentions@alpha
// or
npm install --save react-native-controlled-mentions@alpha

@hirbod
Copy link

hirbod commented May 16, 2022

@dabakovich sorry for hijacking this, but is support for Async fetches also supported OOTB?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v3 Feature and fixes for the major v3 release
Projects
None yet
Development

No branches or pull requests

4 participants