Autoselect on blur/unfocus from old script

44 views Asked by At

I am using this script: https://github.com/PebbleRoad/combo-select

I've set it up, works great and lightweight. I want it to select the closest option(highlighted) on close(blur?) or submit - changing it's value to it. I noticed it already does this when punching numbers in the demo page: http://pebbleroad.github.io/combo-select/ however when it's words it does not work.

Similar bigger scripts like select2 or selectize already have a built-in feature but is much heaver with features I simply don't need. I tried using autoFocus as I believe it's part of the new jQuery library but it doesn't work.

$(function(){
  $('select')
  .comboSelect({ autoFocus: true })
})
0

There are 0 answers