Skip to content

Commit aa8719e

Browse files
committed
fix to issue #91 - optgroup selected ignored
1 parent bd0b7f0 commit aa8719e

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

public/jquery.selectric.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* /,'
1010
* /'
1111
*
12-
* Selectric Ϟ v1.9.3 (Jun 03 2015) - http://lcdsantos.github.io/jQuery-Selectric/
12+
* Selectric Ϟ v1.9.3 (Jul 08 2015) - http://lcdsantos.github.io/jQuery-Selectric/
1313
*
1414
* Copyright (c) 2015 Leonardo Santos; Dual licensed: MIT/GPL
1515
*
@@ -178,7 +178,8 @@
178178

179179
var $options = $original.children(),
180180
_$li = '<ul>',
181-
selectedIndex = $options.filter(':selected').index(),
181+
$justOptions = $original.find('option'),
182+
selectedIndex = $justOptions.index($justOptions.filter(':selected')),
182183
currIndex = 0;
183184

184185
currValue = (selected = ~selectedIndex ? selectedIndex : 0);

public/jquery.selectric.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jquery.selectric.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@
161161

162162
var $options = $original.children(),
163163
_$li = '<ul>',
164-
selectedIndex = $options.filter(':selected').index(),
164+
$justOptions = $original.find('option'),
165+
selectedIndex = $justOptions.index($justOptions.filter(':selected')),
165166
currIndex = 0;
166167

167168
currValue = (selected = ~selectedIndex ? selectedIndex : 0);

0 commit comments

Comments
 (0)