Skip to content

Commit

Permalink
SplitButton OpenAriaLabel and Tree SelectItemAriaLabel added
Browse files Browse the repository at this point in the history
  • Loading branch information
enchev committed Dec 6, 2023
1 parent efae6af commit faab0e8
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Radzen.Blazor/RadzenSplitButton.razor
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<span class="rz-button-text">&nbsp;</span>
}
}
</button><button disabled="@IsDisabled" onclick="@OpenPopupScript()" class="@getPopupButtonCss()" type="button">
</button><button disabled="@IsDisabled" onclick="@OpenPopupScript()" class="@getPopupButtonCss()" type="button" aria-label="@OpenAriaLabel">
<span aria-hidden="true" class="rz-button-icon-left rzi rzi-chevron-down"></span><span class="rz-button-text"></span>
</button>
<div id="@PopupID" class="rz-splitbutton-menu">
Expand Down
7 changes: 7 additions & 0 deletions Radzen.Blazor/RadzenSplitButton.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ private string getButtonSize()
[Parameter]
public bool AlwaysOpenPopup { get; set; }


/// <summary>
/// Gets or sets the open button aria-label attribute.
/// </summary>
[Parameter]
public string OpenAriaLabel { get; set; } = "Open";

/// <summary>
/// Gets or sets the click callback.
/// </summary>
Expand Down
6 changes: 6 additions & 0 deletions Radzen.Blazor/RadzenTree.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ namespace Radzen.Blazor
/// </example>
public partial class RadzenTree : RadzenComponent
{
/// <summary>
/// Gets or sets the open button aria-label attribute.
/// </summary>
[Parameter]
public string SelectItemAriaLabel { get; set; } = "Select item";

/// <inheritdoc />
protected override string GetComponentCssClass()
{
Expand Down
2 changes: 1 addition & 1 deletion Radzen.Blazor/RadzenTreeItem.razor
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
@if(Tree != null && Tree.AllowCheckBoxes)
{
<RadzenCheckBox Name="@($"{GetHashCode()}")" TValue="bool?" Value="@IsChecked()" Change="@CheckedChange" />
<RadzenCheckBox Name="@($"{GetHashCode()}")" TValue="bool?" Value="@IsChecked()" Change="@CheckedChange" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", Tree.SelectItemAriaLabel }})" />
}
@if (Template != null)
{
Expand Down
4 changes: 2 additions & 2 deletions RadzenBlazorDemos/Pages/CascadingDropDowns.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
<RadzenCard>
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H3">1. Customers</RadzenText>
<RadzenDropDown Style="width:300px" TValue="string" @bind-Value="CustomerID" Placeholder="Select customer" AllowFiltering="true"
Data="@(customers)" TextProperty="CompanyName" ValueProperty="CustomerID"
Data="@(customers)" TextProperty="CompanyName" ValueProperty="CustomerID" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "Select customer" }})"
Change="@(args => { orders = dbContext.Orders.Where(o => o.CustomerID == CustomerID); })"/>
</RadzenCard>
</div>
<div class="col-xl-6 mb-4">
<RadzenCard>
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H3">2. Orders</RadzenText>
<RadzenDropDown Style="width:300px" TValue="int" @bind-Value="OrderID" Placeholder="Select order"
Data="@(orders)" ValueProperty="OrderID"
Data="@(orders)" ValueProperty="OrderID" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "Select order" }})"
Change="@(args => { orderDetails = dbContext.OrderDetails.Where(o => o.OrderID == OrderID).Include("Product"); })">
<Template>
Order Date: @String.Format("{0:d}", ((Order)context).OrderDate)
Expand Down
2 changes: 1 addition & 1 deletion RadzenBlazorDemos/Pages/DataGridEmpty.razor
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<h3 class="mt-4">Custom Empty Text</h3>
<div class="mb-4">
Custom text: <RadzenTextBox @bind-Value="emptyText" class="ml-2" Style="width: 300px;" />
Custom text: <RadzenTextBox @bind-Value="emptyText" class="ml-2" Style="width: 300px;" aria-label="custom text" />
</div>
<RadzenDataGrid TItem="Employee" Data="@data" EmptyText="@emptyText">
<Columns>
Expand Down

0 comments on commit faab0e8

Please sign in to comment.