question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MudStepper - PreventStepChange async?

See original GitHub issue

I am looking to run an async method on the PreventStepChange and when I do it seems to lock up the whole MudStepper. The reason is that I want to save the form to the db and wait for response before moving to the next step. Any insight or suggestions?

        <MudStepper @ref="_stepper" ContentStyle="min-height: 400px" Linear="false" Vertical="_vertical" Color="Color.Primary" Variant="Variant.Filled" DisableAnimation="false"
                PreventStepChange="new Func<bool>(CheckChange)">

    private bool CheckChange()
    {
         if (_stepper.GetActiveIndex() == 4) {           
           return !Submit().Result;            
        }
        return false;
    }

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
PlayerModucommented, Mar 30, 2023

@mckaragoz Thank you for providing a solution to the problem so quickly 😃 I’ll reach out if I come across any more issues related to this issue

1reaction
mckaragozcommented, Mar 30, 2023

@mckaragoz that looks even better 😄 Thank you for responding and providing a potential solution so quickly!

What would be the timeline on getting your PR for this completed and out in a new release?

6.4.6 just released 🙂 Please note that PreventStepChangeAsync uses Task<bool> instead of bool.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular material stepper before-selection-change & ...
Short answer: Once you've rendered stepper component on the page. You should loop through all steps of the stepper, and override built-in select ......
Read more >
Angular material stepper before-selection-change & ...
I am using linear mat-stepper. It works fine with next. I do api call & if it's success then i call stepper-next event...
Read more >
Stepper (selectionChange) vs (selectionChanged) and ...
Emit a new event (selectionChange) = 'before' the step has changed, with option to cancel the action, which doesn't get automatically triggered ...
Read more >
Stepper
Angular Material's stepper provides a wizard-like workflow by dividing content into logical steps. Material stepper builds on the foundation of the CDK ...
Read more >
Stepper - Angular Material
Event emitted when the selected step has changed. steps: QueryList<MatStep>. Steps that belong to the current stepper, excluding ones from nested steppers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found