-
Notifications
You must be signed in to change notification settings - Fork 39
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
changed event fired before slider value updated #24
Comments
Can you create a ember-twiddle that shows the problem? I am having a hard time understanding and I think I haven't experienced this before. |
here it is : update the value of the slider and check the console log. |
Noticed this as well - curiously the issue does not seem present in the samples, but maybe they're doing something silly with timeouts.. |
I had the same issue and found something to make it work. Just add an arg to your action and then save it to the model (and send it to your backend etc) : https://ember-twiddle.com/48621eb153ca73ef075f0b4331f16f0e?openFiles=controllers.application.js%2C Hope it helps ! |
i am doing a post request inside the changed event callback,
my problem is that when i save my model (post it to the backend) it contains an attribute that's binded to the value of the slider, but at that point the slider value is not updated yet it get's updated later on after the changed event is fired, so i am sending an old value of the slider.
exp
onValueChanged(newValue, evt){
this.get("model").save();
}
i can do a simple solution as
onValueChanged(newValue, evt){
this.set("model.bindedValue", newValue);
this.get("model").save();
}
but it make no sense in my head because later on the bindedValue will be updated anyway so why should it be done twice.
should i make a PR or for some reason the changed event should be fired before value is updated???
The text was updated successfully, but these errors were encountered: