Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26507] Windows: View.center is not respected when left & top is set.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionWon't Do
Resolution Date2018-11-01T22:02:41.000+0000
Affected Version/sRelease 7.5.0
Fix Version/sn/a
ComponentsWindows
Labelsn/a
ReporterKota Iguchi
AssigneeKota Iguchi
Created2018-11-01T03:52:32.000+0000
Updated2018-11-01T22:02:41.000+0000

Description

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.

Comments

  1. Kota Iguchi 2018-11-01

    Confirmed this behavior is consistent across platforms. We don't have to change this behavior.

JSON Source