Megabit / Blazorise

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.
https://blazorise.com/
Other
3.3k stars 533 forks source link

Async/await support for NavigationAllowed in Steps component #4688

Open SvetlanaIo opened 1 year ago

SvetlanaIo commented 1 year ago

Hello! I have the following task related to Steps. I must make it possible to go to the next step only if the form is valid. This works fine while i dont use async validators. I would really like to have support for asynchronous methods. Like example below.

  async Task<bool> NavigationAllowed(StepNavigationContext context)
  {
    bool result = true;
    if (context.CurrentStepIndex == 1 && !await _validation.ValidateAsync())
      result = false;
    return result;
  }
stsrki commented 1 year ago

We can try to add an async callback in the following milestone if there is enough time. In the meantime, we're open to any contribution if you have some time to spare.

stsrki commented 8 months ago

@David-Moreira, do you think we should do this change in 1.5? It is kinda a breaking change for the user if it suddenly stops working as an async. And if we introduce a new NavigationAllowedAsync,, we go against our naming guidelines without the *Async suffix.