Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a class in optgroup results in an error on refresh in chrome #2442

Closed
riv333 opened this issue Apr 22, 2020 · 1 comment
Closed

Using a class in optgroup results in an error on refresh in chrome #2442

riv333 opened this issue Apr 22, 2020 · 1 comment

Comments

@riv333
Copy link

riv333 commented Apr 22, 2020

I tested with Version 1.13.15 with Chrome and Bootstrap 4.3.1

When one add a class in the optgroup:

<select name="test"  id="select-test" class="selectpicker w-100 test-select">
  <optgroup label="Test Options">
      <option selected>test1</option>
      <option>test2</option>
  </optgroup>
  <optgroup class="bugtest" id="bugtest-id" label="Test"> //class="bugtest" makes problems
  </optgroup>
</select>

And dynamically add some options with:
$('#bugtest-id').html(options);

Then appears an error on:
$('#select-test').selectpicker('refresh');

One get in Chrome the error:

bundle.js:1374 Uncaught DOMException: Failed to execute 'add' on 'DOMTokenList': The token provided must not be empty.
    at Object.a (http://localhost:3000/js/bundle.js:1374:77)
    at buildElement (http://localhost:3000/js/bundle.js:2265:30)
    at Selectpicker.buildList (http://localhost:3000/js/bundle.js:2311:9)
    at Selectpicker.refresh (http://localhost:3000/js/bundle.js:3646:12)
    at HTMLSelectElement.<anonymous> (http://localhost:3000/js/bundle.js:3772:35)
    at Function.each (http://localhost:3000/js/bundle.js:9034:19)
    at jQuery.fn.init.each (http://localhost:3000/js/bundle.js:8869:17)
    at jQuery.fn.init.Plugin [as selectpicker] (http://localhost:3000/js/bundle.js:3744:22)

Without the class tag class="bugtest" there are no problems

caseyjhol added a commit that referenced this issue Apr 22, 2020
@caseyjhol
Copy link
Member

Released in v1.13.16!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants