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

double quote breaks the text when the user select the result #66

Open
amin-alnasra opened this issue Oct 29, 2016 · 1 comment
Open

Comments

@amin-alnasra
Copy link

for example

if the text ( welcome to my site "site.com" we are happy with you )
the auto complete will put in the box after select ( welcome to my site)
it's cut all text after first double quote ("site.com" we are happy with you)

I hope solve this issue ASAP

best regards
and thank you for this awesome script

@amin-alnasra
Copy link
Author

amin-alnasra commented Oct 29, 2016

I solved the issue by customize the render function

 renderItem:function (item, search){
search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
var re = new RegExp("(" + search.split(' ').join('|') + ")", "gi");

return '<div class="autocomplete-suggestion" data-val="' + item.replace(/"/g, '&quot;') + '">' + item.replace(re, "$1") + '</div>';}

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

1 participant