Skip to content

Commit

Permalink
Merge d03e1e2 into 3ae883a
Browse files Browse the repository at this point in the history
  • Loading branch information
helrac committed May 3, 2018
2 parents 3ae883a + d03e1e2 commit 7151444
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions addon/components/inputs/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion addon/components/inputs/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export default AbstractInput.extend({
return {
options: A([]),
itemsInitialized: false,
ignoreEmptyFilterSearch: false,
waitingOnReferences: false
}
},
Expand Down Expand Up @@ -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})
}
},
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7151444

Please sign in to comment.