chore: only allow whitespace after valid character in super item selection
This commit is contained in:
@@ -20,7 +20,7 @@ export function useTypeaheadAllowingSpacesAndPunctuation(
|
|||||||
(text: string) => {
|
(text: string) => {
|
||||||
const validChars = '[^' + trigger + ']'
|
const validChars = '[^' + trigger + ']'
|
||||||
const TypeaheadTriggerRegex = new RegExp(
|
const TypeaheadTriggerRegex = new RegExp(
|
||||||
'(^|\\s|\\()(' + '[' + trigger + ']' + '((?:' + validChars + '){0,' + maxLength + '})' + ')$',
|
'(^|\\s|\\()(' + '[' + trigger + ']' + '(\\S(?:' + validChars + '){0,' + maxLength + '})' + ')$',
|
||||||
)
|
)
|
||||||
const match = TypeaheadTriggerRegex.exec(text)
|
const match = TypeaheadTriggerRegex.exec(text)
|
||||||
if (match !== null) {
|
if (match !== null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user