signavio / react-mentions

@mention people in a textarea
https://react-mentions.vercel.app
Other
2.48k stars 574 forks source link

Feature Request: Ability to render a div, instead of a textarea. #513

Open comberj opened 3 years ago

comberj commented 3 years ago

Hi there,

Big fan of the library!

I was wondering if having the ability to render a div instead of a textarea or input based on prop values would be possible with minimal effort. The use-case for this is displaying the mentioned users, with highlights, outside of the standard input area.

For instance, in a blog or forum type situation, if a user was to submit a post, mentioning several users. Ideally I'd like to be able to display that post, highlighting the users mentioned ( like slack, for example ), without having other users be able to edit.

I can achieve something along these lines by using the disabled/ aria-disabled props on the MentionsInput component, however, I have to include a Mentions component as a child of the MentionsInput for this to work without erroring.

Let me know if theres already a more semantically correct work-around in place, or if I'm missing something.

Thank you!

julitroalves commented 3 years ago

I'm very interested in this feature.

ashotmark commented 1 week ago

Yes, this is required in our project