Skip to content

dynamically added active tab in angular does not show any panel content #2420

@kirchsuSICKAG

Description

@kirchsuSICKAG

Describe the bug

When using the sl-tab-group in angular and adding a new tab dynamically, which should be directly active, the new tab panel content is not shown. Instead there is no tab panel shown at all.

To Reproduce

Steps to reproduce the behavior:

  1. Go to this stackblitz
  2. Click on sl-button, which adds a new active tab
  3. See the problem of no panel content is shown at all

Screenshots

Image

Image

Browser / OS

  • OS: all
  • Browser: all
  • Browser version:

Additional information

This problem seems to be only appearing with angular, because it handles some timings / lifecycles different than the other frameworks (like vue and react)

The caches of the tab-panels and tabs in the tab-group is done e.g. on slotchange. But for angular this is not enough. For this bug, the slotchange fires too late.

This bug can be fixed by no longer using a cache for the panels and tabs but just use e.g. the @queryAssignedElements of lit

I would be willing to create a PR for this bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThings that aren't working right in the library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions