react-mentions
react-mentions copied to clipboard
Mention doesn't work for double brackets
We use variables in our forms with the format {{Model}}. The idea is to show the mentions when someone types the first two curly brackets {{.
Steps to reproduce:
- Create a Mention component using the following
trigger={/({{(\w*))$/}
Expected behaviour:
We expected to put two or three variables in the same input like: {{Model}} {{Make}} {{Car}}
Observed behaviour:
The issue comes when we type two variables and we add the third variable at the beginning of the input. So for example, we have:
{{Model}} {{Make}}
and then we add {{Car}} variable on the left of {{Model}} variable, the mention dropdown doesn't show up and the first variables it's removed.
If you try the same example but changing curly bracket ({) for square brackets ([) it works:
<Mention markup="{{__id__}}" trigger=/(\[\[(\w*))$/ ... />
Type: ((Model)) ((Make)) ((Car))
So this is a specific problem with double curly brackets only {{
Any update on this issue? We too are stuck because of this issue.