Skip to content

Commit 2878572

Browse files
Merge dimodi-patch-2-tabstrip-2999 into production (#3002)
* docs(TabStrip): Set tab ID as parameter * Update events.md --------- Co-authored-by: Dimo Dimov <[email protected]>
1 parent 3e4c28b commit 2878572

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

components/tabstrip/events.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,33 @@ This article explains the events available in the Telerik TabStrip for Blazor:
1717

1818
## ActiveTabIdChanged
1919

20-
The `ActiveTabIdChanged` event fires when the user changes the active tab. The event handler receives the new tab ID of type `string` as an argument. This event is designed to work with the new [`ActiveTabId` parameter](slug:tabstrip-tabs-collection).
20+
The `ActiveTabIdChanged` event fires when the user changes the active tab. The event handler receives the new tab ID of type `string` as an argument. If the `Id` parameter of the `TabStripTab` is not set, the component will generate one automatically.
21+
22+
The `ActiveTabIdChanged` event is designed to work with the new [`ActiveTabId` parameter](slug:tabstrip-tabs-collection).
2123

2224
>caption Handle the tab ID selection changed event
2325
2426
````RAZOR
2527
<TelerikTabStrip ActiveTabIdChanged="@HandleTabIdChange">
26-
<TabStripTab Title="First">
28+
<TabStripTab Title="First" Id="tab1">
2729
First tab content. Click through the tabs.
2830
</TabStripTab>
29-
<TabStripTab Title="Second">
31+
<TabStripTab Title="Second" Id="tab2">
3032
Second tab content.
3133
</TabStripTab>
32-
<TabStripTab Title="Third">
34+
<TabStripTab Title="Third" Id="tab3">
3335
Third tab content.
3436
</TabStripTab>
3537
</TelerikTabStrip>
3638
3739
@Result
3840
3941
@code {
40-
private string Result { get; set; }
42+
private string Result { get; set; } = string.Empty;
43+
4144
private void HandleTabIdChange(string tabId)
4245
{
43-
Result = $"Current tab ID is {tabId}";
46+
Result = $"The current tab ID is {tabId}";
4447
}
4548
}
4649
````

components/tabstrip/tabs-collection.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To deactivate all tabs, set the ActiveTabId parameter to `string.Empty`.
2727
@{
2828
foreach (var tab in Tabs)
2929
{
30-
<TabStripTab @key="tab.Id" Title="@tab.Title" Visible="@tab.Visible" Disabled="@tab.Disabled">
30+
<TabStripTab @key="@tab.Id" Id="@tab.Id" Title="@tab.Title" Visible="@tab.Visible" Disabled="@tab.Disabled">
3131
<HeaderTemplate>
3232
<span>@tab.Title</span>
3333
</HeaderTemplate>
@@ -54,11 +54,11 @@ To deactivate all tabs, set the ActiveTabId parameter to `string.Empty`.
5454
private string ActiveTabId { get; set; }
5555
5656
private List<Tab> Tabs { get; set; } = new List<Tab>
57-
{
58-
new Tab { Id = "home", Title = "🏠 Home", Visible = true, Disabled = false },
59-
new Tab { Id = "profile", Title = "👤 Profile", Visible = true, Disabled = false },
60-
new Tab { Id = "settings", Title = "⚙️ Settings", Visible = true, Disabled = false }
61-
};
57+
{
58+
new Tab { Id = "home", Title = "🏠 Home", Visible = true, Disabled = false },
59+
new Tab { Id = "profile", Title = "👤 Profile", Visible = true, Disabled = false },
60+
new Tab { Id = "settings", Title = "⚙️ Settings", Visible = true, Disabled = false }
61+
};
6262
6363
public class Tab
6464
{

0 commit comments

Comments
 (0)