mjangir / formik-wizard-form Goto Github PK
View Code? Open in Web Editor NEWBuild multi step forms using Formik with ease.
Home Page: http://formikwizard.manishjangir.com
License: MIT License
Build multi step forms using Formik with ease.
Home Page: http://formikwizard.manishjangir.com
License: MIT License
I think it would be usefull to add ability to passing props to Form component.
For example I need to prevent form submitting on enter, so I want to add onKeyDown handler on Form
<Form onKeyDown={ e => { if ((e.key === 'Enter') && (e.target.tagName !== 'BUTTON' || e.target.type !== 'submit')) { e.preventDefault() } }}>
If a form step is invalid, the next button will be disabled after clicking on the previous button
The valid step should be seen as valid and the next button should be enabled
The materialui sample: https://codesandbox.io/s/material-formik-wizard-form-h37hs?from-embed
force a validation when going back ?
Software | Version(s) |
---|---|
Formik Wizard Form | 2.0.1 |
Formik | 2.2.9 |
React | 17.0.2 |
TypeScript | 4.1.2 |
Browser | chrome 95 |
npm/Yarn | yarn 1.22.11 |
Operating System | win 10 |
I am facing some weird bugs with this package.
if I use npm
package , I got this error :
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `FormikWizardProvider`.
but if I use files from ./src
(like example) the error will disappear.
Yup scheme example:
someFieldsArray: yup.array().of(yup.object().shape({
fieldName: yup.string().required(),
anotherFieldName: yup.string().requried(),
})),
stepValidation file ->
const stepValidator = ({errors}) => ...???
If you revisit the wizard after submission, it is still at the final step. How can I reset step index ?
Hi, I'd suggest you provide an adaptation to React Native. Thanks
This looks awesome, especially the ability to validate each step.
One question, the browser's forward and back buttons are disabled in your example, but could they be used to navigate between steps? That's what I like about this solution, the forward and back buttons still work as expected, and there is a Prompt component that prevents data loss if the user accidentally tries to navigate away from the form (which could potentially be done through site navigation or a bookmark even if the forward and back buttons are disabled).
Love the project. but will this be maintained in the future? Don't see any updates for the last 2 years.
Hi mjangir,
Thanks for sharing your code. Do you by chance have an example of using
a 3rd Party control like "react-select" in your wizard that maintains state and onchange events as you use the navigation buttons to go back and forth in the wizard. Thanks so much for the reply.
I have found the section with examples and the section with bootstrap is empty:
https://formikwizard.manishjangir.com/docs/examples/bootstrap
Can you please take a look at this link? If you can the sample, it would be very helpful to fix the link. ๐
Thanks for this library, it is really helpful.
Jan
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.