You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you paste in the autocomplete field it does'nt trigger the Ajax request.
Steps to reproduce:
Paste/Insert a name in the autocomplete (Let's say John)
The autocomplete will trigger the Ajax request and we will see the "John" name in there.
Don't select John. Click outside of the autocomplete so it triggers the focusout and the search is cleared.
Paste John again. Now it will not search anymore. You can clear the field with cut (Ctrl + X on windows) and paste again many times you want, it will not trigger the ajax search anymore.
So, debugging i found that the problem was in the "onKeyUp" function on line 451 of jquery.autocomplete.js . Is on the line 466 if
if(that.currentValue!==that.el.val()){
If you search and don't select like in the steps explained earlier, the that.currentValue would be the last requested value (in our case was John) and when you paste it again the that.el.val() would be John (the same as the currentValue).
So it will never fall under the if. My provisional solution right now is doing an else with that.currentValue = '':
if(that.currentValue!==that.el.val()){that.findBestHint();if(that.options.deferRequestBy>0){// Defer lookup in case when value changes very quickly: that.onChangeTimeout=setTimeout(function(){that.onValueChange();},that.options.deferRequestBy);}else{that.onValueChange();}}else{that.currentValue=''}
It fixed the problem, but i don't know if that's the best solution or if will ending up creating new bugs.
The text was updated successfully, but these errors were encountered:
Problem:
When you paste in the autocomplete field it does'nt trigger the Ajax request.
Steps to reproduce:
My configuration for the autocomplete:
Solution
So, debugging i found that the problem was in the "onKeyUp" function on line 451 of jquery.autocomplete.js . Is on the line 466 if
If you search and don't select like in the steps explained earlier, the that.currentValue would be the last requested value (in our case was John) and when you paste it again the that.el.val() would be John (the same as the currentValue).
So it will never fall under the if. My provisional solution right now is doing an else with that.currentValue = '':
It fixed the problem, but i don't know if that's the best solution or if will ending up creating new bugs.
The text was updated successfully, but these errors were encountered: