简体   繁体   中英

Bootstrap selectpicker focus event

I am currently using the bootstrap plugin "selectpicker", ant I am showing a searchbar using : data-live-search="true"

I am facing a little problem with this. When I navigate the form using "tab", and I arrive to my selectpicker field, two things can happen:

  • I can press the down arrow, and then the searchbar will be focused, this is what I want.
  • If I start to type letters instead of the down arrow, it will not focus the field, which is quite bad for user experience.

I thought to focus the searchbar as soon as the selectpicker field is focused, but I don't know how to create a focus event on a selectpicker...

Any idea?

Thanks!

我遇到了同样的问题,并且事件“ show.bs.select”(来自selectpicker插件规范)最终成为了解决方案,希望它对您也有用。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM