react-mentions icon indicating copy to clipboard operation
react-mentions copied to clipboard

Mention doesn't work for double brackets

Open emunchen opened this issue 6 years ago • 1 comments

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:

  1. 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 {{

emunchen avatar Jun 14 '19 14:06 emunchen

Any update on this issue? We too are stuck because of this issue.

palerdot avatar Apr 08 '21 15:04 palerdot