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
I havean eventlistener on the view2 for touch events.
view2.addEventListener('touch_start',func1);
Inside the listener function I deference the objects into constants starting from the event source element.
function func1(e) {
const view2=e.source,
view1=view2.view1,
obj=view1.obj;
Now if I update the obj attrbutes, for eample:
obj.attribute1 = 'Correct value';
On Android the code works correctly, on iOS it not works!
When I call another funcion and dereference the obj again the changes are lost! ( I am using transpile = true )
func2(view2);
It seems that the object is somewhere cloned in the const assigment process, loosing the reference in the original object but it happens only on iOS.
function func2(view2) {
console.log(view2.view1.obj.attribute1);
}
Anyway there is an easy workaround to fix this problem. You can just do:
if (!OS_ANDROID) view2.view1.obj=obj;
And everything will work also on iOS.
Expected Behavior
view2.view1.obj.attribute1 = 'Correct Value';
Actual behavior
view2.view1.obj.attribute1 = 'Wrong Value';
Reproducible sample
Not ready at the moment
Steps to reproduce
Not ready at the moment
Platform
iOS
SDK version you are using
12.1.2.GA
Alloy version you are using
No response
The text was updated successfully, but these errors were encountered:
I have searched and made sure there are no existing issues for the issue I am filing
Description
I have one object with some attributes nested in a UI.View, inside another UI.View.
I havean eventlistener on the view2 for touch events.
Inside the listener function I deference the objects into constants starting from the event source element.
Now if I update the obj attrbutes, for eample:
On Android the code works correctly, on iOS it not works!
When I call another funcion and dereference the obj again the changes are lost! ( I am using transpile = true )
It seems that the object is somewhere cloned in the const assigment process, loosing the reference in the original object but it happens only on iOS.
Anyway there is an easy workaround to fix this problem. You can just do:
And everything will work also on iOS.
Expected Behavior
Actual behavior
Reproducible sample
Not ready at the moment
Steps to reproduce
Not ready at the moment
Platform
iOS
SDK version you are using
12.1.2.GA
Alloy version you are using
No response
The text was updated successfully, but these errors were encountered: