Skip to content

Commit

Permalink
split className by whitespace instead of a single space to prevent em…
Browse files Browse the repository at this point in the history
…pty strings being part of the array (#2442)
  • Loading branch information
caseyjhol committed Apr 22, 2020
1 parent 158704d commit 44d6487
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@
}
}

if (typeof classes !== 'undefined' && classes !== '') a.classList.add.apply(a.classList, classes.split(' '));
if (typeof classes !== 'undefined' && classes !== '') a.classList.add.apply(a.classList, classes.split(/\s+/));
if (inline) a.setAttribute('style', inline);

return a;
Expand Down

0 comments on commit 44d6487

Please sign in to comment.