diff --git a/addon/components/inputs/autocomplete.js b/addon/components/inputs/autocomplete.js index 4dc6fa07..7c75389e 100644 --- a/addon/components/inputs/autocomplete.js +++ b/addon/components/inputs/autocomplete.js @@ -10,6 +10,12 @@ export default SelectInput.extend({ layout, + getDefaultProps () { + return { + ignoreEmptyFilterSearch: true + } + }, + /** * This should be overriden by inherited inputs to convert the value to the appropriate format * @param {String} data - value to parse diff --git a/addon/components/inputs/select.js b/addon/components/inputs/select.js index 44272133..6da86000 100644 --- a/addon/components/inputs/select.js +++ b/addon/components/inputs/select.js @@ -61,6 +61,7 @@ export default AbstractInput.extend({ return { options: A([]), itemsInitialized: false, + ignoreEmptyFilterSearch: false, waitingOnReferences: false } }, @@ -252,7 +253,6 @@ export default AbstractInput.extend({ // Make sure we flag that we've begun fetching items so we don't queue up // a bunch of API requests back to back this.set('itemsInitialized', true) - this.get('updateItems').perform({value: newValue, keepCurrentValue: needsInitialItems}) } }, @@ -502,6 +502,12 @@ export default AbstractInput.extend({ 'store' ) + if (this.ignoreEmptyFilterSearch && isEmpty(filter)) { + // sets options back to it's original data. This should usually be empty unless using static data. + this.set('options', data) + return + } + const options = getMergedOptions(bunsenModel, cellConfig) if (options.endpoint) {