-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Default selected options are empty #147
Comments
Gist.run is up and running again, please provide an example. |
https://gist.run/embed.html?id=761ac31e78d1110224f0e61e32db3e27 I couldn't import the i18n libary however. Without that the bug will not appear. |
I've replicated it locally and both values are selected in both examples. So it seams something else is causing the issue maybe? One thing I noticed is your translation key Select something. Is that really the key, containing a blank space? Btw. I've tried it with the recent release |
I will look further then. I never had issues with keys containing spaces. |
It seems that when i add I can't find any leads that it's on my side besides that in I can't make a working demo but i am sure that i18n is causing this. |
ok so can you create a zip file containing the CLI src folder, aurelia.json and locales and upload it somewhere, so that I can reproduce it? |
@VMBindraban if you wanna use cli, you can use the swan-client-sample aurelia-cli branch |
I managed to isolate the issue in git.run. You need to import aurelia-i18n (again). https://gist.run/embed.html?id=761ac31e78d1110224f0e61e32db3e27 When you look in the console i am logging the What i assume that happens, when i18n is changing the value, the select sees that as a change and sets the value to the translated option. Is this a possible binding issue? |
Ok so after our conversation in gitter @VMBindraban I think we've traced the bug a little bit further. If we console log the valueChanged with new/old value we get 3 calls:
call 1 is the default setting it from empty to the id. @jdanyow do you have an idea why the promised call to updateValue, caused from the TCustomAttribute interfers with the Changed hook in the component? |
👍 Support + watching thread. |
Bump. Any progress on this? |
I'll take a look |
@jdanyow Any news on this? |
@zewa666 Bump, any progress? It's kinda delaying our project. |
Sorry about the delay, @jdanyow is pretty busy with getting things done for the Validation Plugin and referenced work in other framework parts. In the meantime can you @VMBindraban tell me whether changing the promised return to a straight forward one inside the updateValue method fixes your issue?
the easiest way to test it out is if you're using Aurelia CLI, to open up the
in there just fix the above mentioned line. It feels like this deferred call is already responsible for multiple issues, so by having your positive answer to that I guess I'll simply go ahead and publish a fix release. We can determine the root cause for this later, without blocking you guys any further. |
@VMBindraban I took a look at the gist- couple question for you:
|
@jdanyow @VMBindraban ok I think I have now a better understanding of this Promise thingy ... it was introduced with a previous enhancement which turned out to introduce a lot of regressions. There is a new PR pending. As for this issue if @VMBindraban you could just verify that the change I proposed previously I can merge the PR right away and get 4 bugs done straight in a row :) |
@zewa666 That didn't work. @jdanyow I only kept de bare minimal to duplicate the issue:
{
id:1,
name: "foo"
createdAt:"2016-10-07T12:57:44.000Z",
updatedAt:"2016-10-07T13:11:50.000Z"
} I tried both |
I've merged the PR anyway since its part of this bug as well. It definitely won't harm, but we need to closer look at the current issue. @jdanyow any new insights? |
The PR did not resolve the problem. For now we are going to use |
and `npm run e2e` script references aurelia#147
I'm submitting a bug report
1.0.0
Please tell us about your environment:
Linux Ubuntu 16.04
4.4.4
2.15.1
JSPM 0.16.36
Chrome 51
all
Current behavior:
When using a translation on the first option, no fields are default selected.
Expected/desired behavior:
Gist.run is down.
Value contains an array with the selected items.
When using translation (see above), the
value
becomesnull
between thebind
andattached
cycle. When removingt="- Select a value -"
, it works.Given values should be selected.
It doesn't work correctly.
The text was updated successfully, but these errors were encountered: