bootstrap-select: Setting `val` doesn't work
Using the following $('.selectpicker').selectpicker('val', '1'); to preset the value of my select is returning the following error.
Uncaught TypeError: e.stopPropagation is not a function
The error is pointing to line 258 in bootstrap-select.js if it helps. i.e.
if (e) {
e.stopPropagation();
e.preventDefault();
}
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 16 (3 by maintainers)
Commits related to this issue
- release v1.12.1 (fix #1167) — committed to JoshLabs/bootstrap-select by caseyjhol 8 years ago
Replace the conventional code:
For this:
I tried the following and it works.
@D-Skywalker 's suggestion did not work for me, and I built on that to include additional refresh.
I believe there is some sort of delay induced by
$target.selectpicker("refresh");which is causing this issue.