: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
this._move( "next", event );
case $.ui.keyCode.PAGE_UP:
this._move( "first", event );
case $.ui.keyCode.PAGE_DOWN:
this._move( "last", event );
this.menu.trigger( event );
_selectFocusedItem: function( event ) {
var item = this.menuItems.eq( this.focusIndex ).parent( "li" );
if ( !item.hasClass( "ui-state-disabled" ) ) {
this._select( item.data( "ui-selectmenu-item" ), event );
_select: function( item, event ) {
var oldIndex = this.element[ 0 ].selectedIndex;
// Change native select element
this.element[ 0 ].selectedIndex = item.index;
this.buttonItem.replaceWith( this.buttonItem = this._renderButtonItem( item ) );
this._trigger( "select", event, { item: item } );
if ( item.index !== oldIndex ) {
this._trigger( "change", event, { item: item } );
_setAria: function( item ) {
var id = this.menuItems.eq( item.index ).attr( "id" );
"aria-activedescendant": id
this.menu.attr( "aria-activedescendant", id );
_setOption: function( key, value ) {
var icon = this.button.find( "span.ui-icon" );
this._removeClass( icon, null, this.options.icons.button )
._addClass( icon, null, value.button );
this._super( key, value );
if ( key === "appendTo" ) {
this.menuWrap.appendTo( this._appendTo() );
_setOptionDisabled: function( value ) {
this.menuInstance.option( "disabled", value );
this.button.attr( "aria-disabled", value );
this._toggleClass( this.button, null, "ui-state-disabled", value );
this.element.prop( "disabled", value );
this.button.attr( "tabindex", -1 );
this.button.attr( "tabindex", 0 );
var element = this.options.appendTo;
element = element.jquery || element.nodeType ?
this.document.find( element ).eq( 0 );
if ( !element || !element[ 0 ] ) {
element = this.element.closest( ".ui-front, dialog" );
element = this.document[ 0 ].body;
_toggleAttr: function() {
this.button.attr( "aria-expanded", this.isOpen );
// We can't use two _toggleClass() calls here, because we need to make sure
// we always remove classes first and add them second, otherwise if both classes have the
// same theme class, it will be removed after we add it.
this._removeClass( this.button, "ui-selectmenu-button-" +
( this.isOpen ? "closed" : "open" ) )
._addClass( this.button, "ui-selectmenu-button-" +
( this.isOpen ? "open" : "closed" ) )
._toggleClass( this.menuWrap, "ui-selectmenu-open", null, this.isOpen );
this.menu.attr( "aria-hidden", !this.isOpen );
_resizeButton: function() {
var width = this.options.width;
// For `width: false`, just remove inline style and stop
this.button.css( "width", "" );
// For `width: null`, match the width of the original element
width = this.element.show().outerWidth();
this.button.outerWidth( width );
_resizeMenu: function() {
this.menu.outerWidth( Math.max(
this.button.outerWidth(),
// IE10 wraps long text (possibly a rounding bug)
// so we add 1px to avoid the wrapping
this.menu.width( "" ).outerWidth() + 1
_getCreateOptions: function() {
var options = this._super();
options.disabled = this.element.prop( "disabled" );
_parseOptions: function( options ) {
options.each( function( index, item ) {
data.push( that._parseOption( $( item ), index ) );
_parseOption: function( option, index ) {
var optgroup = option.parent( "optgroup" );
hidden: optgroup.prop( "hidden" ) || option.prop( "hidden" ),
optgroup: optgroup.attr( "label" ) || "",
disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
this._unbindFormResetHandler();
this.element.removeUniqueId();
this.labels.attr( "for", this.ids.element );