custom source: get_keyword_pattern vs get_trigger_characters #971
-
I'm working on creating a custom source and I'm confused as to what get_keyword_pattern and get_trigger_characters do. For context, I'm working on a cmp source that only suggests items when "b/" is typed. Setting the keyword_pattern to ‘b’ and the trigger character to ‘/’ seems to work, but the source:complete function gets called every time ‘b’ is typed. Ideally, this function would only be called when ‘b/’ is typed. I appreciate the help! Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The solution is to have the keyword pattern be 'b/' and omitting the trigger characters. The other important part is that the response item labels have to begin with the keyword pattern, e.g. 'b/' in this case. |
Beta Was this translation helpful? Give feedback.
The solution is to have the keyword pattern be 'b/' and omitting the trigger characters. The other important part is that the response item labels have to begin with the keyword pattern, e.g. 'b/' in this case.