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

Pasting some long text into the input can cause the entire long text to be highlighted #118

Open
fullStackOasis opened this issue May 20, 2023 · 4 comments
Labels
help wanted Extra attention is needed v3 Feature and fixes for the major v3 release

Comments

@fullStackOasis
Copy link

fullStackOasis commented May 20, 2023

The bug is happening in a complex project that I'm working on, but I am able to reproduce this using the example project in the source code here.

I cloned your project, and made a few small changes, but the changes were for clarity. You can demo the issue with your own example code and no changes.

Steps to reproduce:

  1. Copy into your clipboard the following text (select/copy): is a simple python script that uses yt-dlp to scrape all of a youtube channels
  2. Run your example project.
  3. Press into the input and delete the default text.
  4. Press on the input, and type the "@" character, which brings up the user suggestions. Choose David Tabaka.
  5. Type a single space character. You do not need to type the space character if you've set isInsertSpaceAfterMention: true for the "@" trigger because it is automatically inserted.
  6. Long press in the input to get the Android menu with various options. Choose the "paste as plain text" option.
  7. The text that you copied is pasted into the input, and almost immediately you see the entire content displayed as part of the controlled mention.

You can checkout my project, install it, and run it to demo the issue.
https://github.com/fullStackOasis/react-native-controlled-mentions-example

Once the bug happens, I've found that the app eventually crashes if I continue typing enough. As I type, all the text shows up as a "mention".

The bug only happens for some samples of text that I copied, not for all of them. With the text that I wrote above, it is 100% reproducible for me.

Any support you can offer is much appreciated!

@fullStackOasis
Copy link
Author

Screenshot showing the issue:

image

@fullStackOasis
Copy link
Author

It appears that this is a React Native bug with TextInput and some specific Android devices. I opened an issue here: facebook/react-native#37502

@dabakovich
Copy link
Owner

Hey @fullStackOasis, thank you for such a clear and detailed feedback!

Sorry for the long wait, I'm currently focused on other projects, and the support for this library is not as active as it used to be.

Please let me know, is this question still relevant? If so, have you tried using the prerelease v3 version of this library? I tried to reproduce your issue on my end with the 3rd version, and the problem didn't occur.

https://github.com/dabakovich/react-native-controlled-mentions/releases/tag/v3.0.0-alpha.2

@dabakovich dabakovich added help wanted Extra attention is needed v3 Feature and fixes for the major v3 release labels Sep 16, 2023
@fullStackOasis
Copy link
Author

@dabakovich Thank you for getting back to this.

I tried installing v3.0.0-alpha.4 - that was the latest - and made a few changes to my sample project, but the problem is still there.

I'm not sure that this problem is in your project, in fact. There's already a bug in React Native in TextInput on some specific devices, so it could be that this is the true problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed v3 Feature and fixes for the major v3 release
Projects
None yet
Development

No branches or pull requests

2 participants