Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

one-way-select and value=undefined #167

Open
marxsk opened this issue Aug 2, 2017 · 0 comments
Open

one-way-select and value=undefined #167

marxsk opened this issue Aug 2, 2017 · 0 comments

Comments

@marxsk
Copy link

marxsk commented Aug 2, 2017

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);
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant