Skip to content

Selectmenu: Better handling when there are no options #1423

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

Closed
wants to merge 1 commit into from

Conversation

scottgonzalez
Copy link
Member

Fixes #10662

This replaces #1370.

I think this is a better way to handle empty lists in general. The fact that we were relying on this.menuItems as a flag for the delayed rendering has always bothered me. This also includes a change that stops the menu from opening when there are no options.

@arschmitz
Copy link
Member

+1 for not opening when no options this is what native does.

@@ -199,7 +202,8 @@ return $.widget( "ui.selectmenu", {
this._refreshMenu();
this.buttonItem.replaceWith(
this.buttonItem = this._renderButtonItem(
this._getSelectedItem().data( "ui-selectmenu-item" )
// Fall back to an empty object in case there are no options
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing blank line above comment

@jzaefferer
Copy link
Member

Looks good

@scottgonzalez scottgonzalez deleted the selectmenu-empty branch March 18, 2015 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants