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

[ERROR undefined] - with regex in trigger

Open bentrinh-asia opened this issue 3 years ago • 3 comments

Steps to reproduce:

  1. Set trigger is /(\( )/
  2. Show error undefined
image

Expected behaviour: Show suggestion list after input (

Observed behaviour: Show error Workaround:

bentrinh-asia avatar Apr 20 '22 04:04 bentrinh-asia

This is still happening and there's no examples of regex trigger in the examples

kasplat avatar Aug 27 '24 22:08 kasplat

@kasplat is there any workaround or simple example of how we can use regex in trigger prop?

harshpadelkaraistra avatar Feb 04 '25 12:02 harshpadelkaraistra

Refer to https://github.com/signavio/react-mentions/issues/765 .

below is my code , it will trigger by @

            trigger={new RegExp(`(@([^@]*))$`)}

LINGyue-dot avatar Feb 06 '25 04:02 LINGyue-dot