-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat(Wizard): add preventNavigation
callback function to onStepChange
#3924
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
preventNavigation´ callback function to
onStepChange`preventNavigation
callback function to onStepChange
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the failing unit test, it looks good to me 🎆 🥳
Maybe @tujoworker also have the time to quickly look through this?
In general I like providing interactive examples instead of just "textual code" as done for this feature in https://eufemia-git-feat-wizard-preventnavigation-eufemia.vercel.app/uilib/extensions/forms/Wizard/Container/#controlling-the-wizard-steps
When it's interactive, I think:
- Consumers/users of the feature will better understand the use case of the example/feature.
- It's easier for a reviewer to test if it actually works.
- We'll write the example/demo as actual code and not just "textual code" which will find potential errors in the example, such as random human coding errors, typescript errors, etc. This will also make it easier to find if we'll make breaking changes(refactoring) to it in the future, etc.
When thinking about it, as an alternative to a demo/example a lot of these points could also be solved by adding story, especially points regarding typescript errors, code errors and future potential refactoring.
Just give it a consideration 🙏
packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/Wizard/Container/info.mdx
Outdated
Show resolved
Hide resolved
66f04d4
to
f96e4bf
Compare
…rms/Wizard/Container/info.mdx Co-authored-by: Anders <[email protected]>
f6879ad
to
e511b76
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Added another test to verify that the validation is run before the preventNavigation
## [10.48.0](v10.47.0...v10.48.0) (2024-09-12) ### 🐛 Bug Fixes * **countries:** Fixes wrong country code for Martinique [#3915](#3915) ([a9f86e4](a9f86e4)) * **countries:** Remove outdated countries [#3915](#3915) ([36ef5cf](36ef5cf)) * **Forms:** rename 'Macedonia' to 'North Macedonia' ([#3918](#3918)) ([a4eb8a4](a4eb8a4)) * **Forms:** rename "Hviterussland" to "Belarus" ([#3917](#3917)) ([702118a](702118a)) * removes outdated countries based on ISO 3166-1 alpha-2 ([#3916](#3916)) ([a045acd](a045acd)) ### ✨ Features * **Forms:** add `toolbarVariant="minimumOneItem"` to Iterate.Toolbar for hiding buttons when there is only one item in the array ([#3919](#3919)) ([3367a77](3367a77)), closes [#3877](#3877) * **Forms:** add `validator` support to Iterate.Array ([#3926](#3926)) ([6fd439e](6fd439e)) * **Forms:** auto-open Form.Section container when fields have errors and add `validateInitially` prop ([#3878](#3878)) ([9b49006](9b49006)) * **Forms:** auto-open iterate containers when validation errors and make `Iterate.Toolbar` fully customizable ([#3877](#3877)) ([52326bf](52326bf)), closes [#3919](#3919) * **Forms:** show optional label when a field uses `required={false}` and add `labelSuffix` prop to each field ([#3921](#3921)) ([60e440a](60e440a)) * **Wizard:** add `preventNavigation` callback function to `onStepChange` ([#3924](#3924)) ([5ec2772](5ec2772))
🎉 This PR is included in version 10.48.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Wizard.Container