center
property is not respected when
left
and
top
is set. Even when these properties are already set,
center
should be respected and update the position of the view. Also, we should be able to use
undefined
to "clear" existing values according to [UNDEFINED behavior](
https://docs.appcelerator.com/platform/latest/#!/guide/UI_Composite_Layout_Behavior_Spec-section-src-4196675_UICompositeLayoutBehaviorSpec-UNDEFINEDbehavior) which is taken care by TIMOB-26507.
var win = Ti.UI.createWindow({
backgroundColor: 'green'
});
var view1 = Ti.UI.createView({
width: 100, height: 100,
top: 100, left: 100,
backgroundColor: 'blue',
});
win.addEventListener('click', function (e) {
// view1.top = undefined;
// view1.left = undefined;
view1.center = { x: e.x, y:e.y };
});
win.add(view1);
win.open();
Expected: View should move to the position where you clicked.
Confirmed this behavior is consistent across platforms. We don't have to change this behavior.