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

patternsConfig bug in v3 alpha #89

Open
OmkarArora opened this issue Jun 27, 2022 · 4 comments
Open

patternsConfig bug in v3 alpha #89

OmkarArora opened this issue Jun 27, 2022 · 4 comments

Comments

@OmkarArora
Copy link

On a successful match from patternsConfig, the text gets deleted rather than getting the desired highlighting

i have referred the example from here - https://github.com/dabakovich/react-native-controlled-mentions/blob/3.0.0-feat-use-mentions/example/mentions-app.tsx#L90

Whenever I write the letter "a" as given in patternsConfig, it gets deleted.

Here is a Snack of my code -
https://snack.expo.dev/@halfcold/react-native-controlled-mentions-v3-alpha-testing

@TrevPennington
Copy link

I'm getting the same issue

@9mzodiac
Copy link

9mzodiac commented Sep 25, 2023

I'm experiencing similar behavior with parseValue

@antochan
Copy link

antochan commented Mar 13, 2024

Same here. Any updates on this issue? @dabakovich

@antochan
Copy link

antochan commented Mar 13, 2024

After a bit of investigation it seems the root issue is from the parseValue function specifically the part where we call const dividedValueByRegex = value.split(regex);

Previously my regex would get split in a way that doesn't really conform to how the library expects. For example https://google.com might result in dividedValueByRegex being ["google.com"] where as the expected value should be [" ", "https://google.com", " "]. For now I have adjusted my regex to ensure that when being called with .split(regex) the format results in the later.

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

No branches or pull requests

4 participants