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

At.who attaches <span class="atwho-query"> whenever # is typed but failed to remove if nothing from list is selected #581

Open
mayur9293 opened this issue Feb 7, 2019 · 2 comments

Comments

@mayur9293
Copy link

At.who attaches <span class="atwho-query"> whenever # followed something is typed but failed to remove the atwho-query class if nothing from the list is selected/ Instead we type anything else apart from list. Hence the atwho-view is formed at the previous position

Sample Looks something like this
Some Data <span class="atwho-query">NotInList&nbsp; Some more data #536 </span>

@bholtbholt
Copy link

bholtbholt commented Mar 18, 2019

This is still a bug, but I've found a workaround by disabling acceptSpaceBar:

$(element).atWho({
  acceptSpaceBar: false,
  ...
});

@bholtbholt
Copy link

bholtbholt commented Mar 19, 2019

I've found a fix for this by modifying the dist version

// Current Line 53
regexp = new RegExp(flag + "([A-Za-z" + _a + "-" + _y + "0-9_" + space + "\'\.\+\-]*)$|" + flag + "([^\\x00-\\xff]*)$", 'gi');

Replace the regex with

regexp = new RegExp(flag + "(\\S[A-Za-z" + _a + "-" + _y + "0-9_" + space + "\'\.\+\-]*)?$|" + flag + "([^\\x00-\\xff]*)$", 'gi');

The changes are adding \\S and ? around the matching group to exclude space characters after @

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

No branches or pull requests

2 participants