diff --git a/IPython/html/static/notebook/js/widgets/widget_selection.js b/IPython/html/static/notebook/js/widgets/widget_selection.js index 54e787d..bdca009 100644 --- a/IPython/html/static/notebook/js/widgets/widget_selection.js +++ b/IPython/html/static/notebook/js/widgets/widget_selection.js @@ -58,7 +58,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){ if (options === undefined || options.updated_view != this) { var selected_item_text = this.model.get('value_name'); - if (selected_item_text.length === 0) { + if (selected_item_text.trim().length === 0) { this.$droplabel.html(" "); } else { this.$droplabel.text(selected_item_text); @@ -233,18 +233,24 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){ var items = this.model.get('value_names'); var disabled = this.model.get('disabled'); var that = this; + var item_html; _.each(items, function(item, index) { - var item_query = ' :contains("' + item + '")'; - if (that.$buttongroup.find(item_query).length === 0) { - $('