[TIMOB-11494] MobileWeb: remove() does not work on Child View of a sub view
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2012-10-25T00:32:00.000+0000 |
Affected Version/s | Release 2.1.2, Release 2.1.3 |
Fix Version/s | n/a |
Components | MobileWeb |
Labels | n/a |
Reporter | Amuktha Akkinepally |
Assignee | Chris Barber |
Created | 2012-10-15T22:57:48.000+0000 |
Updated | 2014-06-19T12:42:52.000+0000 |
Description
When child view is removed from parent view, parent's view does not report correct child count. Below is sample code that reproduce the issue.
Steps to reproduce:
1. Load the below app.js 2. Run it on Mobile web browser. Expected result:The text should display 1. Actual Result: Instead, it incorrectly display 2.
var topView = Ti.UI.createWindow({
backgroundColor: 'white',
title: 'test'
});
var testView = Ti.UI.createView();
var childView1 = Ti.UI.createView();
var childView2 = Ti.UI.createView();
testView.add(childView1);
testView.add(childView2);
// remove second
testView.remove(childView2);
// this should be 1 instead it returns 2
var childCount = testView.children.length;
var label = Ti.UI.createLabel({
text: 'child count '+childCount,
color: 'black'
});
topView.add(label);
topView.open();
Duplicate of TIMOB-11559