ember-one-way-controls icon indicating copy to clipboard operation
ember-one-way-controls copied to clipboard

one-way-select and value=undefined

Open marxsk opened this issue 6 years ago • 0 comments

Usually, when I'm creating a new component it has 'value=undefined' because my fields are generated in the template. When a user changes from the first option to another one, the update action is triggered and value is set properly. But when user does not trigger 'update' action then 'value=undefined'. I would like to have the first option inside. The patch is quite simple but very likely it should be just the configurable option. What do you think? I'm ready to prepare PR if patch like this is acceptable.

addon/components/one-way-select.js:didReceiveAttrs()

...
set(this, 'options', emberArray(options));
+if (value === undefined) {
+   invokeAction(this, 'update', firstOption);
+}

marxsk avatar Aug 02 '17 15:08 marxsk