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

Fix multiple selected detection with optgroup #223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions public/jquery.selectric.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* /,'
* /'
*
* Selectric ϟ v1.13.0 (Aug 22 2017) - http://lcdsantos.github.io/jQuery-Selectric/
* Selectric ϟ v1.13.0 (Feb 02 2018) - http://lcdsantos.github.io/jQuery-Selectric/
*
* Copyright (c) 2017 Leonardo Santos; MIT License
* Copyright (c) 2018 Leonardo Santos; MIT License
*
*/

Expand Down Expand Up @@ -420,7 +420,7 @@
if ( $selected.length > 1 && _this.state.multiple ) {
selectedIndex = [];
$selected.each(function() {
selectedIndex.push($(this).index());
selectedIndex.push($(_this.$element.find('option')).index(this));
});
}

Expand Down Expand Up @@ -650,7 +650,7 @@
}
if (searchRegExp.test(elm.text) || searchRegExp.test(elm.slug)) {
_this.highlight(i);
return;
return false;
}
if (!elm.alt) {
return;
Expand All @@ -662,7 +662,7 @@
}
if (searchRegExp.test(altItems[ai].trim())) {
_this.highlight(i);
return;
return false;
}
}
});
Expand Down
4 changes: 2 additions & 2 deletions public/jquery.selectric.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/plugins/jquery.selectric.addNew.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Selectric AddNew ϟ v0.2.0 (2017-08-22) - git.io/tjl9sQ - Copyright (c) 2017 David Shen (git.io/mhQmLQ) - MIT License */
/*! Selectric AddNew ϟ v0.2.0 (2018-02-02) - git.io/tjl9sQ - Copyright (c) 2018 David Shen (git.io/mhQmLQ) - MIT License */
(function(factory) {
/* global define */
if ( typeof define === 'function' && define.amd ) {
Expand Down
2 changes: 1 addition & 1 deletion public/plugins/jquery.selectric.addNew.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/plugins/jquery.selectric.placeholder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Selectric Placeholder ϟ v0.2.0 (2017-08-22) - git.io/tjl9sQ - Copyright (c) 2017 Leonardo Santos - MIT License */
/*! Selectric Placeholder ϟ v0.2.0 (2018-02-02) - git.io/tjl9sQ - Copyright (c) 2018 Leonardo Santos - MIT License */
(function(factory) {
/* global define */
if ( typeof define === 'function' && define.amd ) {
Expand Down
2 changes: 1 addition & 1 deletion public/plugins/jquery.selectric.placeholder.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/jquery.selectric.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
if ( $selected.length > 1 && _this.state.multiple ) {
selectedIndex = [];
$selected.each(function() {
selectedIndex.push($(this).index());
selectedIndex.push($(_this.$element.find('option')).index(this));
});
}

Expand Down