react-input-trigger icon indicating copy to clipboard operation
react-input-trigger copied to clipboard

Will it support Multiple KeyCode Trigger?

Open ganeshmani opened this issue 6 years ago • 2 comments

I am looking for a feature like slack where user can trigger different action through different input ("/" for command actions and "@" for user mentions). will this library support that?

ganeshmani avatar Oct 16 '19 09:10 ganeshmani

I did, using react, however there were several stumbling blocks that I had to get over. Mainly that I had to nest the triggers in order to get it multiple triggers to work, ie # for tickets and @ for users, and in doing that I had to create a fork to target the correct input element. Also as I am using the Quill editor I had to fork it to have it be able to read and write to the editor without breaking.

In short, yes it;s possible, but unless they've fixed some of the issues I had, you might have to fork it or make some tweaks.

One major downside I had was that it doesn't naturally close the trigger, IE if you just want to put # then later put a link to #12 it fails to catch the second triggering as you have to end the triggering in order for it to catch a another. I was able to work around that by ending the triggers on [return] and perhaps also on a trigger char if there's no list of suggestions.

In short. yes, but it's not really an out of the box system IMO. But it does work for that use.

TonisPiip avatar Oct 16 '19 10:10 TonisPiip

Thanks.. i found this repo which kind of solves the problem for me. react-mentions

ganeshmani avatar Oct 16 '19 13:10 ganeshmani