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

Suggestions for Colouring Tags #7

Open
droegier opened this issue May 23, 2017 · 8 comments
Open

Suggestions for Colouring Tags #7

droegier opened this issue May 23, 2017 · 8 comments

Comments

@droegier
Copy link

Hello, I love this MentionsTextInput component!

Now, I am facing the following challenge : I need to give a different font colour to the mention that the user has selected (like mentions on Facebook). For this I will have to split (or embed) the TextInput component. This seems quite difficult/complex.

Has anyone already given some thought on how to approach this?

Actually, what I need is Facebook's Draft.js capabilities on React Native. So far, this module is the thing that brought me the closest. Any suggestion on which direction to move forward, is highly appreciated!

Thank you.

@scf4
Copy link

scf4 commented Aug 27, 2017

@droegier any progress on this? Draft.js for react native would be fantastic.

@harshq
Copy link
Owner

harshq commented Aug 28, 2017

This is not possible to do at the moment since you cant nest other components inside a textInput. Love to implement something like that though. Any suggestions are welcome.

@scf4
Copy link

scf4 commented Aug 28, 2017

Is it possible to use a regular text component to render the input's text?

Or how about simply putting a text component (with the same text) behind the input, with a background color on the mention text.

@harshq
Copy link
Owner

harshq commented Aug 29, 2017

Kinda feel like it would not be the ideal solution since we will have to manually calculate cursor positions.( eg: text tag will take more space than a text )

@scf4
Copy link

scf4 commented Aug 29, 2017

@harshq Not necessary since it's just the background color, take a look:

ezgif-2-31ac73bb17

https://gist.github.com/scf4/012e9f615f6b43a1712a083b162afd94

The method for splitting words could be done better I'm sure.

@scf4
Copy link

scf4 commented Aug 29, 2017

Actually this becomes problematic when you want to scroll in the input. But perhaps there's a solution?

@asafron
Copy link

asafron commented Jan 15, 2018

@droegier Have you found any solution for coloring the text only after some mention was selected? Maybe using some king of a regex?

@nikhil-raina
Copy link

Actually this becomes problematic when you want to scroll in the input. But perhaps there's a solution?

Has this been addressed? There seems to be something off when trying to scroll the text box from the Android platform. The keyboard glitches and disappears all the time. Even if the '@' has been entered or not.

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

5 participants