From: KH Lau Date: Thu, 8 Feb 2018 04:29:43 +0000 (+0800) Subject: Roo/bootstrap/ComboBox.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=20e935f51c8aa934f67db73282d220a7b3ee91e0 Roo/bootstrap/ComboBox.js --- diff --git a/Roo/bootstrap/ComboBox.js b/Roo/bootstrap/ComboBox.js index 9f7df5ea73..7984e76308 100644 --- a/Roo/bootstrap/ComboBox.js +++ b/Roo/bootstrap/ComboBox.js @@ -27,66 +27,66 @@ Roo.bootstrap.ComboBox = function(config){ /** * @event expand * Fires when the dropdown list is expanded - * @param {Roo.bootstrap.ComboBox} combo This combo box - */ + * @param {Roo.bootstrap.ComboBox} combo This combo box + */ 'expand' : true, /** * @event collapse * Fires when the dropdown list is collapsed - * @param {Roo.bootstrap.ComboBox} combo This combo box - */ + * @param {Roo.bootstrap.ComboBox} combo This combo box + */ 'collapse' : true, /** * @event beforeselect * Fires before a list item is selected. Return false to cancel the selection. - * @param {Roo.bootstrap.ComboBox} combo This combo box - * @param {Roo.data.Record} record The data record returned from the underlying store - * @param {Number} index The index of the selected item in the dropdown list - */ + * @param {Roo.bootstrap.ComboBox} combo This combo box + * @param {Roo.data.Record} record The data record returned from the underlying store + * @param {Number} index The index of the selected item in the dropdown list + */ 'beforeselect' : true, /** * @event select * Fires when a list item is selected - * @param {Roo.bootstrap.ComboBox} combo This combo box - * @param {Roo.data.Record} record The data record returned from the underlying store (or false on clear) - * @param {Number} index The index of the selected item in the dropdown list - */ + * @param {Roo.bootstrap.ComboBox} combo This combo box + * @param {Roo.data.Record} record The data record returned from the underlying store (or false on clear) + * @param {Number} index The index of the selected item in the dropdown list + */ 'select' : true, /** * @event beforequery * Fires before all queries are processed. Return false to cancel the query or set cancel to true. * The event object passed has these properties: - * @param {Roo.bootstrap.ComboBox} combo This combo box - * @param {String} query The query - * @param {Boolean} forceAll true to force "all" query - * @param {Boolean} cancel true to cancel the query - * @param {Object} e The query event object - */ + * @param {Roo.bootstrap.ComboBox} combo This combo box + * @param {String} query The query + * @param {Boolean} forceAll true to force "all" query + * @param {Boolean} cancel true to cancel the query + * @param {Object} e The query event object + */ 'beforequery': true, /** * @event add * Fires when the 'add' icon is pressed (add a listener to enable add button) - * @param {Roo.bootstrap.ComboBox} combo This combo box - */ + * @param {Roo.bootstrap.ComboBox} combo This combo box + */ 'add' : true, /** * @event edit * Fires when the 'edit' icon is pressed (add a listener to enable add button) - * @param {Roo.bootstrap.ComboBox} combo This combo box - * @param {Roo.data.Record|false} record The data record returned from the underlying store (or false on nothing selected) - */ + * @param {Roo.bootstrap.ComboBox} combo This combo box + * @param {Roo.data.Record|false} record The data record returned from the underlying store (or false on nothing selected) + */ 'edit' : true, /** * @event remove * Fires when the remove value from the combobox array - * @param {Roo.bootstrap.ComboBox} combo This combo box - */ + * @param {Roo.bootstrap.ComboBox} combo This combo box + */ 'remove' : true, /** * @event afterremove * Fires when the remove value from the combobox array - * @param {Roo.bootstrap.ComboBox} combo This combo box - */ + * @param {Roo.bootstrap.ComboBox} combo This combo box + */ 'afterremove' : true, /** * @event specialfilter @@ -1357,7 +1357,12 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, { var close = this.closeTriggerEl(); if(close){ - (vv.length || vv * 1 > 0) ? close.show() : close.hide(); + if(dv.length || vv * 1 > 0){ + close.show() ; + this.blockFocus=true; + } else { + close.hide(); + } } if(this.hiddenField){