Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24382] Windows: Adding same component multiple times should not cause error

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2017-02-10T11:10:05.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 6.1.0
ComponentsWindows
Labelsparity
ReporterKota Iguchi
AssigneeKota Iguchi
Created2017-02-08T01:56:44.000+0000
Updated2017-02-13T22:55:50.000+0000

Description

This is parity issue to align with behavior on iOS. We should accept logical error when developer tries to add one component multiple times onto same parent. For instance following code does not throw exception on iOS, but on Windows it causes exception with add: No installed components were detected. Element is already the child of another element. We should be able to ignore this type of logical errors to keep parity with iOS.
var win = Ti.UI.createWindow({backgroundColor:'green'});

var label = Ti.UI.createLabel({text:'Test'});

win.add(label);
win.add(label);
win.open();

Comments

  1. Kota Iguchi 2017-02-09

    https://github.com/appcelerator/titanium_mobile_windows/pull/948
  2. Samir Mohammed 2017-02-13

    Verified improvement, when running the test case provided in the description no error message is shown and the test label is shown on a green background. *Environment*
       Windows Emulator: 10.0.14393
       Phone : Lumia 640 LTE (RM-1073)
       Operating System:
       Name                        = Microsoft Windows 10 Pro
       Version                     = 10.0.14393
       Architecture                = 32bit
       

    CPUs = 4

    Memory = 17034395648 Node.js: Node.js Version = 4.6.0 npm Version = 2.15.9 Titanium SDK: SDK Version = 6.1.0.v20170213134957

JSON Source