Skip to content

2 new options + Trigger the mention autocomplete even when there are characters after the delimiter #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Kobee1203
Copy link

Trigger the mention autocomplete even when there are characters afte the delimiter :
In tinymce, enter the text "hello", then return before this text and hit @ to insert a mention : the autocomplete does not trigger

I refactored to add the new behavior and add 2 options to override this default behavior :
- triggerRegex: regex (string or RegExp object) to allow autocomplete if the preceding text matches the trigger regex. The default allows autocomplete after punctuation characters or whitespaces
- canTriggerAutocomplete: function which returns a boolean and indicate when the autocomplete is triggered. The default allows autocomplete :
- when there is an active selection (see #65)
- when there are characters after the delimiter (new condition)
- if the text preceding the delimiter matches the regex defined by 'triggerRegex'

Nicolas Dos Santos added 2 commits September 20, 2017 18:54
… the delimiter.

Refactoring to override the default behavior. New options:
	- triggerRegex: regex (string or RegExp object) to Allow autocomplete if the preceding text matches the trigger regex. The default allows autocomplete after punctuation characters or whitespaces
	- canTriggerAutocomplete: function which returns a boolean and indicate when the autocomplete is triggered. The default allows autocomplete :
		- when there is an active selection (see StevenDevooght#65)
		- when there are characters after the delimiter (new condition)
		- if the text preceding the delimiter matches the regex defined by 'triggerRegex'
@Kobee1203 Kobee1203 changed the title 2 new options + Trigger the mention autocomplete even when there are characters afte the delimiter 2 new options + Trigger the mention autocomplete even when there are characters after the delimiter Jan 25, 2018
… the delimiter.

fix test 'cancel out': append a whitespace before entering a new mention. We don't allow to trigger the autocomplete if there is any character before the delimiter '@'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant