You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a model bind to a null value, aurelia.binding always convert null (or undefined) to an empty object.
This has for effect to change the binded value in aurelia core and then trigger again (twice) the change handler for the property in the VM.
Code exemple in a view with a select element :
<selectref="select_area"
class="form-control"
id="select_template_zone"
value.bind="imagecropperVM.currentArea"
disabled.bind="!templateSelected"><optionmodel.bind="null" selected>Select a zone...</option><optionrepeat.for="[id,zone] of templatezones.zones" model.bind="id" value="${id}">${zone.name}</option></select>
In this example, when first select option is selected, then a first call to change handler is done with a new value of "null", then automatically a second call is done with the new value sets to "Object" because in aurelia-bindings.js, line 1426, the code checks if "instance" is wether null or undefined and if so, it changes the value to an empty object "{}".
I think this behavior/feature is not what developpers/users expect, so aurelia should handle correctly null or undefined value for bindings instead changing the value.
The text was updated successfully, but these errors were encountered:
When a model bind to a null value, aurelia.binding always convert null (or undefined) to an empty object.
This has for effect to change the binded value in aurelia core and then trigger again (twice) the change handler for the property in the VM.
Code exemple in a view with a select element :
In this example, when first select option is selected, then a first call to change handler is done with a new value of "null", then automatically a second call is done with the new value sets to "Object" because in aurelia-bindings.js, line 1426, the code checks if "instance" is wether null or undefined and if so, it changes the value to an empty object "{}".
I think this behavior/feature is not what developpers/users expect, so aurelia should handle correctly null or undefined value for bindings instead changing the value.
The text was updated successfully, but these errors were encountered: