draft-js-autocomplete-plugin-creator icon indicating copy to clipboard operation
draft-js-autocomplete-plugin-creator copied to clipboard

Allow multi-character trigger string

Open mwegman opened this issue 7 years ago • 7 comments

I know you went a different direction when first fixing this issue but I found another problem when deleting the trigger word that wasn't fixed by the other solution.

I understand if you want to move this part of the logic out of the library as well. I just wanted to start the conversation.

mwegman avatar Feb 09 '17 00:02 mwegman

@mwegman Yeah we ended up taking the other approach because it appeared more flexible for the developer. I think one of the pitfalls of the current mention plugin has been its rigidity so I've been trending towards more flexible solutions if possible. Is there something that this approach has that the other does not?

mjrussell avatar Feb 09 '17 17:02 mjrussell

@mjrussell, I also liked the way you ended up solving the problem last time as well. Unforunately, I wasn't sure how you wanted to fix the problem here:

https://github.com/mjrussell/draft-js-autocomplete-plugin-creator/pull/16/files#diff-606c4595f205dda25d87f3d532c3277bR110

These two lines were hard coded to 1 as well.

mwegman avatar Feb 09 '17 17:02 mwegman

Ugh good catch. Hm seems like we definitely need either the trigger length or the trigger itself then

mjrussell avatar Feb 09 '17 17:02 mjrussell

On the v2 branch that function is configurable as a selection predicate.

paulyoung avatar Feb 09 '17 17:02 paulyoung

See https://github.com/mjrussell/draft-js-autocomplete-plugin-creator/blob/pluginsV2/src/CompletionSuggestions/index.js#L117

paulyoung avatar Feb 09 '17 17:02 paulyoung

@paulyoung, looks good. When do we think the v2 branch will be merged back into master?

mwegman avatar Feb 09 '17 17:02 mwegman

I published a beta NPM tag to play around with. Im not quite sure if I should just stop support v1 of draft-js-plugins at this point or what. Its a little difficult to maintain both branches. They haven't yet released a non beta version of v2.

You can install the pluginsv2 by doing npm install [email protected]

mjrussell avatar Feb 09 '17 17:02 mjrussell