File tree Expand file tree Collapse file tree 3 files changed +2
-19
lines changed
src/BootstrapBlazor/Components Expand file tree Collapse file tree 3 files changed +2
-19
lines changed Original file line number Diff line number Diff 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>
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments