Skip to content

Commit

Permalink
Merge pull request #159 from sandersky/bunsen-6
Browse files Browse the repository at this point in the history
Fix select input bugs
  • Loading branch information
sandersky committed Aug 9, 2016
2 parents 06fd6c8 + c68627c commit bf52cec
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
10 changes: 8 additions & 2 deletions addon/components/select-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,15 @@ export default AbstractInput.extend({
const oldValue = _.get(oldAttrs, 'bunsenStore.value.formValue')

const modelQueryString = JSON.stringify(modelQuery)
const valueVariable = modelQueryString.split('${')[1].split('}')[0]
const parts = modelQueryString.split('${')

// If valueVariable exists in newAttrs & oldAttrs only then evaluate further
if (parts.length < 2) {
return false
}

const valueVariable = parts[1].split('}')[0]

// If valueVariable exists in newAttrs & oldAttrs only then evaluate further
let valueResult = utils.findValue(value, valueVariable, bunsenId)
let oldValueResult = utils.findValue(oldValue, valueVariable, bunsenId)
if (valueResult || oldValueResult) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</div>
<div class={{inputWrapperClassName}}>
{{frost-multi-select
disabled=disabled
disabled=(readonly disabled)
onInput=onInput
onChange=(action "onChange")
data=options
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/frost-bunsen-input-select.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class={{inputWrapperClassName}}>
{{frost-select
class=inputClassName
disabled=disabled
disabled=(readonly disabled)
onBlur=(action "onBlur")
onInput=(action "onInput")
onChange=(action "onChange")
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"ivy-codemirror": "^2.0.2",
"loader.js": "^4.0.1",
"lodash-es": "4.14.1",
"redux": "^3.5.2",
"redux-thunk": "^2.0.1",
"remark-cli": "^1.0.0",
"remark-lint": "^4.0.0",
Expand All @@ -86,9 +87,9 @@
"dependencies": {
"ember-cli-babel": "^5.1.6",
"ember-cli-htmlbars": "^1.0.3",
"ember-cli-sass": "^5.2.0"
"ember-cli-sass": ">=5.2.0 <=5.4.0"
},
"ember-addon": {
"configPath": "tests/dummy/config"
}
}
}

0 comments on commit bf52cec

Please sign in to comment.