Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24406] Android: Unable to modify key of an Object property

GitHub Issuen/a
TypeBug
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 6.0.0, Release 6.0.1
Fix Version/sn/a
ComponentsAndroid
LabelsengReviewed, engSchedule, imageview
ReporterYellowcube
AssigneeGary Mathews
Created2017-02-16T04:55:28.000+0000
Updated2020-10-01T19:20:07.000+0000

Description

- Properties which are writable Objects such as Point and Font cannot have their keys directly changed. TEST CASE
var win = Ti.UI.createWindow({
        title: 'TIMOB-24406',
        backgroundColor: 'gray'
    }),
    iv = Ti.UI.createView({
        backgroundColor: 'red',
        width: '320',
        height: '480',
        center: {
            x: (Ti.Platform.displayCaps.platformHeight / 2) + 'px',
            y: (Ti.Platform.displayCaps.platformWidth / 2) + 'px'
        }
    });

win.addEventListener('click', function(e) {
    iv.center.x = (Ti.Platform.displayCaps.platformHeight / 2) - e.x;
    iv.center.y = (Ti.Platform.displayCaps.platformWidth / 2) - e.y;
    //iv.center = {x: e.x, y: e.y}; // workaround
    Ti.API.info('center.x: ' + iv.center.x);
    Ti.API.info('center.y: ' + iv.center.y);
});

win.add(iv);
win.open();

Attachments

FileDateSize
SDK 5.png2017-02-16T04:55:12.000+000013249
SDK 6.png2017-02-16T04:55:12.000+000041802

Comments

  1. Hans Knöchel 2017-02-16

    This is Android right? [~gmathews] Do we have this regression in 6.0.2 already? Might be worth checking in that timeline.
  2. Yellowcube 2017-02-17

    yes, this is happen in Android
  3. Gary Mathews 2017-02-25

    master: https://github.com/appcelerator/titanium_mobile/pull/8850
  4. Lokesh Choudhary 2018-09-24

    Waiting for the conflicts to be resolved in the PR.

JSON Source