File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,20 @@ export default MaterializeInputField.extend({
5151 // jscs: enable
5252 } ,
5353
54+ actions : {
55+ optionSelected ( e ) {
56+ const target = e . target ;
57+ if ( ! this . get ( 'isDisabled' ) ) {
58+ if ( this . get ( 'action' ) ) {
59+ this . sendAction ( 'action' , target . value ) ;
60+ }
61+ else {
62+ this . set ( 'value' , target . value )
63+ }
64+ }
65+ }
66+ } ,
67+
5468 // TODO: this could be converted to a computed property, returning a string
5569 // that is bound to the class attribute of the inputSelector
5670 errorsDidChange : observer ( 'errors' , function ( ) {
Original file line number Diff line number Diff line change 11<label id =" {{ id }} " class =" active" >{{ label }} </label >
22
3- <select onchange ={{ action ( mut value ) value = " target.value " }}
3+ <select onchange ={{ action ' optionSelected ' }}
44 class =" {{ if validate ' validate' }} {{ if errors ' invalid' ' valid' }} "
55 disabled ={{ if disabled " true" }} >
66 {{ #if prompt }}
You can’t perform that action at this time.
0 commit comments