kirbydesign / designsystem

Kirby Design System
https://cookbook.kirby.design
MIT License
82 stars 22 forks source link

[BUG] Order of conditionally rendered tab-bar-button not preserved in tab bar #3399

Closed RasmusKjeldgaard closed 4 months ago

RasmusKjeldgaard commented 4 months ago

Describe the bug

When inserting buttons asynchronously or based on some condition, the order of buttons as inserted in markup is not preserved.

This snippet, where Overview is expected to be the first element:

<kirby-tab-bar>
    <kirby-tab-button *ngIf="true" routerLink="overview">
      Overview
    </kirby-tab-button>

    <kirby-tab-button routerLink="transfer">
      Transfer
    </kirby-tab-button>
    ...

Is actually rendered like this, with Overview as the last element, because of the *ngIf directive: image

Describe how to reproduce the bug

See above.

Which Kirby version was used?

9.3.2

What was the expected behavior?

Order as inserted in html is preserved.


Checklist:

The following tasks should be carried out in sequence in order to follow the process of contributing correctly.

Verification

To make sure the bug is not intended behaviour; it should be verified by a member of team Kirby before moving on to implementation.

Implementation

The contributor who wants to implement this issue should:

Review

Once the issue has been implemented and is ready for review: