Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11494] MobileWeb: remove() does not work on Child View of a sub view

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2012-10-25T00:32:00.000+0000
Affected Version/sRelease 2.1.2, Release 2.1.3
Fix Version/sn/a
ComponentsMobileWeb
Labelsn/a
ReporterAmuktha Akkinepally
AssigneeChris Barber
Created2012-10-15T22:57:48.000+0000
Updated2014-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();

Comments

  1. Bryan Hughes 2012-10-25

    Duplicate of TIMOB-11559

JSON Source