File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
src/BootstrapBlazor/Components/Tab Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 2424 var item = TabItems .Find (i => i .IsActive );
2525 if (item != null )
2626 {
27- @RenderTabItem (item )
27+ < div id = " @item.Id" class = " @GetTabItemClassString(item)" >
28+ @RenderTabItem (item )
29+ < / div >
2830 }
2931 }
3032 else
3133 {
3234 foreach (var item in TabItems )
3335 {
34- @RenderTabItem(item)
36+ <div @key =" @item" id =" @item.Id" class =" @GetTabItemClassString(item)" >
37+ @RenderTabItem(item)
38+ </div >
3539 }
3640 }
3741 </CascadingValue >
Original file line number Diff line number Diff line change @@ -486,6 +486,10 @@ public partial class Tab
486486
487487 private bool IsPreventDefault => _contextMenuZone != null ;
488488
489+ private static string ? GetTabItemClassString ( TabItem item ) => CssBuilder . Default ( "tabs-body-content" )
490+ . AddClass ( "d-none" , item is { IsActive : false } )
491+ . Build ( ) ;
492+
489493 /// <summary>
490494 /// <inheritdoc/>
491495 /// </summary>
You can’t perform that action at this time.
0 commit comments