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
First I will describe my situation to let you know why this issue is important for me.
I have a form on a web page, to which I import data from external source. Right now I use val() to set value of every field in the form. Unfortuanately there is a bug right now in our code considering setting values with jQuery's val() at fields with typeahead enabled: on blur event the field value is reset to an empty one. It was already described in a couple of issue reports at your project e.g. here: #28
What I want to do to solve the problem is to assign to the valHook of text input type a function which detects if a field is typeahead-enabled and if it is run $field.typeahead('val', value) to properly update the internal query property of typeahead, like this:
The main advantage of this solution is transparency. After adding such a hook, I don't need to take care of problems with val() for typeahead-enabled fields, and it will start to work as for other input fields.
Unfortunately, after applying the code above the problem is that setInputValue() which is called at the time of calling $element.typeahead('val', value); calls inside val() from jQuery which makes infinite look.
I'm going to explore removing the jQuery dependency (see #1180). This would solve this issue. In the meantime, I'd prefer not to make one-off changes like this.
Hello!
First I will describe my situation to let you know why this issue is important for me.
I have a form on a web page, to which I import data from external source. Right now I use val() to set value of every field in the form. Unfortuanately there is a bug right now in our code considering setting values with jQuery's
val()
at fields with typeahead enabled: on blur event the field value is reset to an empty one. It was already described in a couple of issue reports at your project e.g. here: #28What I want to do to solve the problem is to assign to the
valHook
oftext
input type a function which detects if a field is typeahead-enabled and if it is run $field.typeahead('val', value) to properly update the internalquery
property of typeahead, like this:The main advantage of this solution is transparency. After adding such a hook, I don't need to take care of problems with
val()
for typeahead-enabled fields, and it will start to work as for other input fields.Unfortunately, after applying the code above the problem is that
setInputValue()
which is called at the time of calling$element.typeahead('val', value);
calls insideval()
from jQuery which makes infinite look.Is it possible to change
setInputValue()
from:to:
This is going to make possible applying the hook above and easily solve problems with value reset on blur event.
Typeahead can be applied only on text fields so the change will not affect the functionality.
The text was updated successfully, but these errors were encountered: