Skip to content

mention autocomplete does not trigger when there is an active selection#65

Open
Kobee1203 wants to merge 1 commit intoStevenDevooght:masterfrom
jalios:autocomplete_with_active_selection
Open

mention autocomplete does not trigger when there is an active selection#65
Kobee1203 wants to merge 1 commit intoStevenDevooght:masterfrom
jalios:autocomplete_with_active_selection

Conversation

@Kobee1203
Copy link

  • Enter some text,
  • select some text,
  • hit @ to replace the currently selected text with an autocomplete : the autocomplete does not trigger

The prevCharIsSpace() function doesn't check if there is a selected text. I added a new condition to check if there is a selected text.
I renamed this function to be consistent with what it does.

@StevenDevooght
Copy link
Owner

Thx, I'll merge this one when I find the time.

Kobee1203 pushed a commit to jalios/tinyMCE-mention that referenced this pull request Jan 25, 2018
… 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 force-pushed the autocomplete_with_active_selection branch from 216d2db to 5dedfdf Compare January 25, 2018 18:06
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.

2 participants