Skip to content

Commit 2de7340

Browse files
gearsdigitallcdsantos
authored andcommitted
fixed a bug, which makes disabled options selectable (#126) (#127)
1 parent a70230c commit 2de7340

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

public/jquery.selectric.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* /,'
1010
* /'
1111
*
12-
* Selectric ϟ v1.10.1 (Sep 21 2016) - http://lcdsantos.github.io/jQuery-Selectric/
12+
* Selectric ϟ v1.10.1 (Sep 22 2016) - http://lcdsantos.github.io/jQuery-Selectric/
1313
*
1414
* Copyright (c) 2016 Leonardo Santos; MIT License
1515
*
@@ -903,6 +903,11 @@
903903
* @param {number} index - Index of the option that will be selected
904904
*/
905905
select: function(index) {
906+
// don't select disabled items
907+
if (index !== -1 && this.lookupItems[index].disabled) {
908+
return false;
909+
}
910+
906911
var _this = this;
907912
var $filteredLi = _this.$li.filter('[data-index]').removeClass('selected');
908913

0 commit comments

Comments
 (0)