File tree Expand file tree Collapse file tree 2 files changed +3
-41
lines changed
src/BootstrapBlazor/Components/Dropdown Expand file tree Collapse file tree 2 files changed +3
-41
lines changed Original file line number Diff line number Diff line change 1- @namespace BootstrapBlazor.Components
1+ @namespace BootstrapBlazor.Components
22@typeparam TValue
33@inherits PopoverSelectBase <TValue >
44@attribute [BootstrapModuleAutoLoader("Dropdown/Dropdown.razor.js", JSObjectReference = true)]
6060 }
6161 else
6262 {
63- <CascadingValue Value =" _items" IsFixed =" true" >
64- @ItemsTemplate
65- </CascadingValue >
66- <RenderTemplate >
67- @foreach( var item in _items )
68- {
69- if (item is DropdownDivider )
70- {
71- < Divider >< / Divider >
72- }
73- else if (item is DropdownItem t )
74- {
75- var disabled = GetItemTriggerClick (t );
76- <DynamicElement @key =" t" class =" @GetItemClassString(disabled)"
77- TriggerClick =" !disabled" OnClick =" () => OnClickItem(t)" >
78- <i class =" @GetItemIconString(t)" ></i >
79- <span >@t.Text </span >
80- </DynamicElement >
81- }
82- }
83- </RenderTemplate >
84- }
63+ @ItemsTemplate
64+ }
8565 </div >
8666</div >
Original file line number Diff line number Diff line change @@ -292,22 +292,4 @@ private async Task HandlerClick()
292292 await OnClick . InvokeAsync ( ) ;
293293 }
294294 }
295-
296- private static string ? GetItemIconString ( DropdownItem item ) => CssBuilder . Default ( "dropdown-item-icon" )
297- . AddClass ( item . Icon , ! string . IsNullOrEmpty ( item . Icon ) )
298- . Build ( ) ;
299-
300- private static string ? GetItemClassString ( bool disabled ) => CssBuilder . Default ( "dropdown-item" )
301- . AddClass ( "disabled" , disabled )
302- . Build ( ) ;
303-
304- private static bool GetItemTriggerClick ( DropdownItem item ) => item . OnDisabledCallback ? . Invoke ( item ) ?? item . Disabled ;
305-
306- private static async Task OnClickItem ( DropdownItem item )
307- {
308- if ( item . OnClick != null )
309- {
310- await item . OnClick ( ) ;
311- }
312- }
313295}
You can’t perform that action at this time.
0 commit comments