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

Enhancement: PWizardStep hooks #872

Open
znicholasbrown opened this issue Aug 1, 2023 · 0 comments
Open

Enhancement: PWizardStep hooks #872

znicholasbrown opened this issue Aug 1, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@znicholasbrown
Copy link
Contributor

znicholasbrown commented Aug 1, 2023

Recently ran into a situation where we wanted to show a confirmation modal before moving on to the next step of a wizard. The logic for if the wizard can be advanced lives (correctly) in a validation step but validation shouldn't change stepping behavior. We should instead expose hooks like onBeforeNext and onBeforePrevious that would allow that navigation to abort or proceed as needed (maybe something like returning true/false if the hook is defined). This would provide better places to do things like warn before leaving the step.

Alternatively but less ideal, we could expose per-step action slots to override the next behavior. This is less ideal because it requires creating multiple components for otherwise encapsulated logic and would probably reduce code readbility

@znicholasbrown znicholasbrown added the enhancement New feature or request label Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant