Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RadzenSteps - Added AllowStepSelect parameter #1591

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading