Skip to content

[BUG] TableLayout issues #3033

Description

@jsfan3

Test case:

TableLayout tl = new TableLayout(1, 2);
Form hi = new Form("Replace Test Case", tl);
Label labelA = new Label("A");
Label labelB = new Label("B");
Label labelC = new Label("C");
hi.add(tl.createConstraint().widthPercentage(85), labelA);
hi.add(tl.createConstraint().widthPercentage(15), labelB);
hi.addShowListener(l -> {
    hi.replace(labelA, labelC, CommonTransitions.createFade(2000));
});
hi.show();

Current wrong result:

screen1

The same wrong result is produced by:

TableLayout tl = new TableLayout(1, 2);
Form hi = new Form("Replace Test Case", tl);
Label labelA = new Label("A");
Label labelB = new Label("B");
Label labelC = new Label("C");
hi.add(tl.createConstraint().widthPercentage(85), labelA);
hi.add(tl.createConstraint().widthPercentage(15), labelB);
hi.addShowListener(l -> {
    int index = hi.getComponentIndex(labelA);
    labelA.remove();
    hi.add(index, labelC);
    hi.revalidateWithAnimationSafety();
});
hi.show();

The correct expected result in both cases should be:

screen2

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions