mi6 / mi6/ic-ui-kit

Make `ic-tab-context` use named slots for its sub-components

Open
#2,573 3 comments 0 reactions 0 assignees View on GitHub
breaking change tabs component
Dominant language
TypeScript
Stars
53
Forks
63
Avg merge
2d 4h
Merged PRs (30d)
15

Description

## Summary
Make `ic-tab-context` use named slots for the `ic-tab-group` and `ic-tab-panel` components so that the order in which they are rendered in the DOM can be enforced.

## 💬 Description
There is an issue with dynamically rendering tabs - the tab panels get displayed above the tabs / tab group. Although a [workaround has been found](https://github.com/mi6/ic-ui-kit/pull/2510) which involves adding an empty `` into the `ic-tab-context`, it would be good to update the `ic-tab-context` component to provide a proper fix for this.

The suggestion is to use named slots (rather than a single unnamed slot) so that the `ic-tab-group` will always be rendered above the `ic-tab-panel` components, e.g.:
```

```

## 💰 User value
This should prevent the issue with the tab panels being rendered above the tab group.

## Additional info
This was mentioned as a possible solution in [PR #2510](https://github.com/mi6/ic-ui-kit/pull/2510). It should fix the issue but if not, keep on trying to find another solution (although a lot of investigation into this has been done already and it seems like the only solution).

**Important:** Once this ticket has been completed, create a ticket to update the code examples on the website.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the ic-tab-context component and PR #2510, then inspect how ic-tab-group and ic-tab-panel are rendered. Done means the tab group renders before the panels without the empty span workaround; also create the requested follow-up ticket for the website code examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.