marcj/jquery-selectBox

autocomplete is not working

Opened this issue · 1 comments

When you set the autocomplete to a property to a value from https://html.spec.whatwg.org/multipage/forms.html#autofill-field the select box is not automatically set by a form filler like Chrome or LastPass. Normal select boxes get set by these. An example would be a select box for country in an address form or the expiration month and year for a credit card on a form.

Auto complete is working with the underlying select, which makes it very confusing to users. To work around you'll need to manually listen to the change event fired by autocomplete and set the select box value:

$('select').selectBox().on("change", function(){
  $(this).selectBox("value", $(this).val());
});