Skip to content

Commit

Permalink
RadzenSteps - Added AllowStepSelect parameter (#1591)
Browse files Browse the repository at this point in the history
  • Loading branch information
Techoneshot authored Jul 11, 2024
1 parent a56cfc5 commit 4ea1f20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Radzen.Blazor/RadzenSteps.razor
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{
<li class="@step.GetItemCssClass()" @attributes="step.Attributes" style="@step.Style" tabindex="@(step.Disabled ? -1 : 0)" @onkeypress="@(args => OnKeyPress(args, SelectStep(step, true)))" @onkeypress:preventDefault=preventKeyPress @onkeypress:stopPropagation>
<a id="@(GetId() + i.ToString() + "s")" title="@step.Title" aria-label="@step.AriaLabel"
@onclick="@(async (args) => { if (!step.Disabled) { await SelectStep(step, true); } })"
@onclick="@(async (args) => { if (!step.Disabled && AllowStepSelect) { await SelectStep(step, true); } })"
@onclick:preventDefault="true" class="rz-menuitem-link">
<span class="rz-steps-number">@(steps.Where(s => s.Visible).ToList().IndexOf(step) + 1)</span>
@if (step.Template != null)
Expand Down
7 changes: 7 additions & 0 deletions Radzen.Blazor/RadzenSteps.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ public string PreviousTitle
[Parameter]
public RenderFragment Steps { get; set; }

/// <summary>
///
/// </summary>
/// <value><c>true</c> user can jump to any step if enabled; <c>false</c> user can change steps only with step buttons (previous/next).</value>
[Parameter]
public bool AllowStepSelect { get; set; } = true;

List<RadzenStepsItem> steps = new List<RadzenStepsItem>();

/// <summary>
Expand Down

0 comments on commit 4ea1f20

Please sign in to comment.