diff --git a/Radzen.Blazor/RadzenAccordion.razor.cs b/Radzen.Blazor/RadzenAccordion.razor.cs index e6a84ef8b08..c298a67c20f 100644 --- a/Radzen.Blazor/RadzenAccordion.razor.cs +++ b/Radzen.Blazor/RadzenAccordion.razor.cs @@ -163,6 +163,8 @@ protected string ItemAriaLabel(int index, RadzenAccordionItem item) internal async System.Threading.Tasks.Task SelectItem(RadzenAccordionItem item, bool? value = null) { + if(item.Disabled) return; + await CollapseAll(item); var itemIndex = items.IndexOf(item); diff --git a/Radzen.Blazor/RadzenAccordionItem.cs b/Radzen.Blazor/RadzenAccordionItem.cs index b41cf5c82b4..206584f5e69 100644 --- a/Radzen.Blazor/RadzenAccordionItem.cs +++ b/Radzen.Blazor/RadzenAccordionItem.cs @@ -36,6 +36,13 @@ public partial class RadzenAccordionItem : RadzenComponent [Parameter] public bool Selected { get; set; } + /// + /// Gets or sets a value indicating whether this is disabled. + /// + /// true if disabled; otherwise, false. + [Parameter] + public bool Disabled { get; set; } + /// /// Gets or sets the title attribute of the expand button. /// diff --git a/RadzenBlazorDemos/Pages/AccordionDisableExpandCollapse.razor b/RadzenBlazorDemos/Pages/AccordionDisableExpandCollapse.razor new file mode 100644 index 00000000000..20316cf482f --- /dev/null +++ b/RadzenBlazorDemos/Pages/AccordionDisableExpandCollapse.razor @@ -0,0 +1,26 @@ + + + + + + + + + + + + Details for Orders + + + Details for Employees + + + Details for Customers + + + + + +@code { + bool canCollapse = true; +} \ No newline at end of file diff --git a/RadzenBlazorDemos/Pages/AccordionPage.razor b/RadzenBlazorDemos/Pages/AccordionPage.razor index f9175ee1fce..b06906aa13f 100644 --- a/RadzenBlazorDemos/Pages/AccordionPage.razor +++ b/RadzenBlazorDemos/Pages/AccordionPage.razor @@ -32,6 +32,12 @@ + + Disable expand/collapse + + + + Keyboard Navigation