diff --git a/addon/components/md-select.js b/addon/components/md-select.js index 116c7fa0..e8fb1644 100644 --- a/addon/components/md-select.js +++ b/addon/components/md-select.js @@ -51,6 +51,20 @@ export default MaterializeInputField.extend({ // jscs: enable }, + actions: { + optionSelected(e) { + const target = e.target; + if (!this.get('isDisabled')) { + if (this.get('action')) { + this.sendAction('action', target.value); + } + else { + this.set('value', target.value) + } + } + } + }, + // TODO: this could be converted to a computed property, returning a string // that is bound to the class attribute of the inputSelector errorsDidChange: observer('errors', function() { diff --git a/addon/templates/components/md-select.hbs b/addon/templates/components/md-select.hbs index 17c2d764..c2506bc0 100644 --- a/addon/templates/components/md-select.hbs +++ b/addon/templates/components/md-select.hbs @@ -1,6 +1,6 @@ -