Skip to content
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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

None yet

2 participants