Skip to content

Commit 5fdaee0

Browse files
ArgoZhangMusaZ
andauthored
feat(TabItem): add Id parameter (#6124)
* chore: bump version 9.7.1-beta02 Co-Authored-By: MusaZ <[email protected]> * feat-tab --------- Co-authored-by: MusaZ <[email protected]>
1 parent 0289df5 commit 5fdaee0

File tree

4 files changed

+3
-20
lines changed

4 files changed

+3
-20
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.7.1-beta01</Version>
4+
<Version>9.7.1-beta02</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/BaseComponents/IdComponentBase.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ public abstract class IdComponentBase : BootstrapComponentBase
2929
/// </summary>
3030
protected virtual string? RetrieveId() => Id;
3131

32-
/// <summary>
33-
/// <inheritdoc/>
34-
/// </summary>
35-
protected override void OnInitialized()
36-
{
37-
base.OnInitialized();
38-
39-
Id ??= ComponentIdGenerator.Generate(this);
40-
}
41-
4232
/// <summary>
4333
/// <inheritdoc/>
4434
/// </summary>

src/BootstrapBlazor/Components/Tab/TabItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace BootstrapBlazor.Components;
88
/// <summary>
99
/// TabItem component
1010
/// </summary>
11-
public class TabItem : ComponentBase
11+
public class TabItem : IdComponentBase
1212
{
1313
/// <summary>
1414
/// Gets or sets the text. Default is null

src/BootstrapBlazor/Components/Tab/TabItemContent.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ internal class TabItemContent : IComponent
1515
[Parameter, NotNull]
1616
public TabItem? Item { get; set; }
1717

18-
/// <summary>
19-
/// Gets <see cref="IComponentIdGenerator"/> instrance
20-
/// </summary>
21-
[Inject]
22-
[NotNull]
23-
private IComponentIdGenerator? ComponentIdGenerator { get; set; }
24-
2518
private RenderHandle _renderHandle;
2619

2720
void IComponent.Attach(RenderHandle renderHandle)
@@ -49,7 +42,7 @@ private void BuildRenderTree(RenderTreeBuilder builder)
4942
builder.OpenElement(0, "div");
5043
builder.SetKey(_key);
5144
builder.AddAttribute(5, "class", ClassString);
52-
builder.AddAttribute(6, "id", ComponentIdGenerator.Generate(Item));
45+
builder.AddAttribute(6, "id", Item.Id);
5346
builder.AddContent(10, Item.ChildContent);
5447
builder.CloseElement();
5548
}

0 commit comments

Comments
 (0)