Closed Jcarlosjunior closed 9 years ago
The binding is working wonderfully for promised properties, the only thing is that a binding to a promise property that doensnt have a promisedValue (is null and/or not even set) is treating like it is a selection from the dropdown, because the placeholder don't show up and the "x" (from the allowClear option) is visible.
This fix will be included in the next release, I will reference this issue in the roadmap issue :)
I swear this used to work for me but has recently regressed. Perhaps because I've been upleveling ember and ember data?
I have a select for a hasOne relationship called 'resource' that looks like this:
{{select-2
optionLabelPath='name'
placeholder=(format-message (intl-get 'attributes.resource-node.resource'))
query='queryResources'
value=model.resource
}}
My select renders fine if model.resource is null, but if it has a value, the select doesn't render even after the promise has been resolved.
I'm using:
{{select-2 value=myValue content=myContent optionLabelPath='name' allowClear=true}}
If "myValue" in the example above is a "belongsTo" in ember-data, even when it doenst have a content it's value is not null or any falsy value, because the property it's a promise that resolves to its promised (real) value. I think if the ember-select-2 could see if the property is a promise and check if there is a promised value to set the dropdown as selected or not.