ivirabyan / jquery-mentions

Adds mentioning support to your text fields.
http://ivirabyan.github.io/jquery-mentions/
MIT License
114 stars 49 forks source link

Bug with inserting a period after mention #37

Closed deronsizemore closed 8 years ago

deronsizemore commented 9 years ago

Hey, me again with another bug. ;)

Just noticed that if for example I'm adding the @mention to the end of a sentence and wanted to add a period after the mention to close the sentence, there's a bug with the jquery-mentions. Once you enter the mention, it adds the mention to the editor with a space after the mention, so once you backspace to add the period, that also pops open the mention drop down box again because it thinks you want to go back and change or edit the mention. You can go ahead and add the period, but the mention drop down never disappears from you screen.

ivirabyan commented 9 years ago

You said mention dropdown never dissapers, so I think it is the same problem as in #36

deronsizemore commented 9 years ago

Yeah, sounds like it may be related. Could be a regex thing where it thinks the period is a part of the name or something maybe. Seems like it may be tricky as I assume on most sites, periods can be used as a part of usernames, so you'd want to register them, but not after inserting the period after inserting the mention. I guess the popup shouldn't pop back up when you backspace to enter the period is what I'm trying to say. Here's a quick video capture I took of it happening on my end; hope it helps:

https://youtu.be/jXMPGlNtOgA

ivirabyan commented 9 years ago

Looks really strange. Don't have idea why this happens, and I can't reproduce it myself. Anyway, problem with space at the end of the mention is now solved, just use the last version from repository.

deronsizemore commented 9 years ago

Thanks for all of your work on this. If you can't reproduce it, then I guess it's probable that it's maybe the contenteditable wysiwyg editor I'm using. I'll download the newest release and give it a go. I appreciate it.

ivirabyan commented 9 years ago

@deronsizemore is problem still present?

deronsizemore commented 9 years ago

Sorry for the delay. I set up a basic example on my end to test with; just a contenteditable div and it doesn't look like the problem is happening with the updated code. It appears that it's only a problem when you force a space after the mention. If there is no space after the mention, it seems to be okay.