Closed coniel closed 6 years ago
Hey! I don't think it's problem in RTA. Could you please provide repro. Easiest would be use this CodePen https://codepen.io/jukben/pen/bYZqvR as start.
What I'm thinking is about is that you return an empty array in [] from the provider, because you are seeking for @}. Could you please check it?
Anyway, thanks for this issues. I'm going to help you as much as possible!
It is indeed returning []. However, when I write something like in the gif:
\frac{@foo}{@}
it's not seeking @}
but it's seeking foo}{@}
. Basically, the RegEx is finding the wrong @.
Here's a pen showing basically how I use it: https://codepen.io/anon/pen/LmWbNQ
Thank you so much for the help btw!
I see. 👍 That's actually another feature. Your use case is very specifics so I'm wondering how to solve it properly. This component is build to follow trigger point to the end of the word but in your case, it might be good to have some "boundaries" set, not sure how, though.
Do you have any idea what would you expect? Reset the trigger when another trigger is typed – @first@second
- in current implementation output functor get first@second
, with the new one it will get the second
. That would make sense, probably. The only disadvantage is that you can't get token with the same char as the actual trigger point.
I will try to enhance the behavior for your use-case as a part of #61. It's quite huge change, though. But I hope it should be possible to solve it. Stay tuned. 👍
I think I have a similar problem:
I wanna use it in a project but there is an requirement named "Group mentions", which means besides the known "@user" autocomplete there is also an "@@group" feature.
So I have two triggers: "@" and "@@". My problem is that since "@" is triggered, the trigger of "@@" only fires once and than after another char never again.
Here you can finde the example code: https://codesandbox.io/embed/8x9qww899l
@Psyphant Thanks for the reporting! I've just released new version which fixing this behavior. (Let's move hypothetical discussion into #145 )
@Psyphant Thanks for the reporting! I've just released new version which fixing this behavior. (Let's move hypothetical discussion into #145 )
@jukben I have to thank! That was an incredible fast fix 👍
The popup is not triggered when there is no space between the typed trigger and other text which already includes a trigger. It works fine if I omit the @ symbol from the inserted text. However, I need to keep the @ symbol in the inserted text as it is used later to find variables in the text and replace them with their values.
I tried reading through the code but couldn't figure out what would cause this behaviour.
Here's a gif demonstrating the problem: