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

add different nextButtonProps for each Dialog in MultistepDialog #4579

Closed
Kaby-Lake opened this issue Mar 11, 2021 · 1 comment · Fixed by #4610
Closed

add different nextButtonProps for each Dialog in MultistepDialog #4579

Kaby-Lake opened this issue Mar 11, 2021 · 1 comment · Fixed by #4610

Comments

@Kaby-Lake
Copy link

Question

I have a MultistepDialog with several sub-dialogs in it, and I want to custom each dialog with different code to define if the nextButton should be disabled or not. For now, the only API nextButtonProps can just set the global Props for all nextButtons.

something like this
Screen Shot 2021-03-11 at 10 52 47 PM

@adidahiya
Copy link
Contributor

adidahiya commented Mar 18, 2021

I think we should have an API that accepts a callback for each step:

type AllowedButtonProps = Pick<IButtonProps, "disabled" | "text">;

export interface IMultistepDialogProps extends IDialogProps {
    /**
     * Props for the back button.
     */
    backButtonProps?: Partial<AllowedButtonProps> | (step: DialogStepId) => Partial<AllowedButtonProps>;

    /**
     * Props for the next button.
     */
    nextButtonProps?: Partial<AllowedButtonProps> | (step: DialogStepId) => Partial<AllowedButtonProps>;

    // ...
}

open to PRs for the above change... or I will get to it some time in April

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants