draft-js-autocomplete-plugin-creator
draft-js-autocomplete-plugin-creator copied to clipboard
Allow multi-character trigger string
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 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, 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.
Ugh good catch. Hm seems like we definitely need either the trigger length or the trigger itself then
On the v2 branch that function is configurable as a selection predicate.
See https://github.com/mjrussell/draft-js-autocomplete-plugin-creator/blob/pluginsV2/src/CompletionSuggestions/index.js#L117
@paulyoung, looks good. When do we think the v2 branch will be merged back into master?
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]