mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-17 06:20:26 +00:00
Fix for issue 1262
This commit is contained in:
parent
f22b7c8395
commit
b35274a8a4
1 changed files with 8 additions and 3 deletions
|
|
@ -22,7 +22,7 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
|
|||
nativeMenu: false
|
||||
},
|
||||
_create: function(){
|
||||
|
||||
|
||||
var self = this,
|
||||
|
||||
o = this.options,
|
||||
|
|
@ -33,7 +33,12 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
|
|||
selectID = select.attr( "id" ),
|
||||
|
||||
label = $( "label[for="+ selectID +"]" ).addClass( "ui-select" ),
|
||||
|
||||
|
||||
//IE throws an exception at options.item() function when
|
||||
//there is no selected item
|
||||
//select first in this case
|
||||
selectedIndex = select[0].selectedIndex == -1 ? 0 : select[0].selectedIndex,
|
||||
|
||||
button = ( self.options.nativeMenu ? $( "<div/>" ) : $( "<a>", {
|
||||
"href": "#",
|
||||
"role": "button",
|
||||
|
|
@ -41,7 +46,7 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
|
|||
"aria-haspopup": "true",
|
||||
"aria-owns": menuId
|
||||
}) )
|
||||
.text( $( select[0].options.item(select[0].selectedIndex) ).text() )
|
||||
.text( $( select[0].options.item( selectedIndex ) ).text() )
|
||||
.insertBefore( select )
|
||||
.buttonMarkup({
|
||||
theme: o.theme,
|
||||
|
|
|
|||
Loading…
Reference in a new issue