Skip to content

one-way-select and value=undefined #167

@marxsk

Description

@marxsk

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);
+}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions