Skip to content

Commit

Permalink
Clear filter on close
Browse files Browse the repository at this point in the history
  • Loading branch information
sandersky committed Nov 1, 2016
1 parent b29bc82 commit 96375fa
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions addon/components/frost-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ export default Component.extend(PropTypeMixin, {

actions: {
closeDropDown () {
this.set('opened', false)
this.setProperties({
filter: '',
opened: false
})

// We need to make sure focus goes back to select since it is on the
// filter text input while the dropdown is open
Expand All @@ -255,10 +258,17 @@ export default Component.extend(PropTypeMixin, {
},

selectItem (selectedValue) {
this.setProperties({
opened: this.get('multiselect'),
const isMultiselect = this.get('multiselect')
const props = {
opened: isMultiselect,
selectedValue
})
}

if (!isMultiselect) {
props.filter = ''
}

this.setProperties(props)

const onChange = this.get('onChange')

Expand Down

0 comments on commit 96375fa

Please sign in to comment.