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

Selection not set when using a RecordArray as content and a PromiseObject as value #20

Closed
mphasize opened this issue May 26, 2015 · 1 comment

Comments

@mphasize
Copy link

I'm trying to build a select box to let the user choose a models.belongsTo property from a list of models retrieved through the store. While the selection process in general is working, the initial selection after reloading the page is not set.

x-select content=recordArray selection=model.belongsToRecord optionValuePath="content" optionLabelPath="content.title"

If I use recordArray.content and model.belongsToRecord.content, the initial selection is set properly, but the selection process stops working ( the model.belongsToRecord is not properly set anymore ).

Digging in with the Ember Inspector I can see that the value on the x-select component is a PromiseObject whereas the value of the x-option component is the resolved value of the Promise.

I guess the comparison between those two with an === operator is not working.

mphasize added a commit to mphasize/emberx-select that referenced this issue May 26, 2015
…PromiseObject` as *value* or *selection* parameter.
@masciugo
Copy link

Same problem here, but calling content solved the initial selection problem keeping, as opposed to @mphasize, selection process working.

{{#x-select value=model.belongsToRecord.content action="selectAction"}}
  {{#each recordArray as |item|}}
    {{#x-option value=item}}{{item.name}}{{/x-option}}
  {{/each}}
{{/x-select}}

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

Successfully merging a pull request may close this issue.

3 participants