Comments (4)
Would it be possible to have a renderParent that includes all the fields instead of base on one field? @vantezzen.
<AutoForm fieldConfig={{
renderParent: ({childFieldA}, {childFieldB}, {childFieldC}) => <div>
<row>
<colA> {childFieldA} </colA>
<colB> {childFieldB> </colB>
</row>
</div>
}}> </AutoForm>
from auto-form.
Hey, thank you for the feedback. As for hidden fields you have two options:
- Most likely your form submission etc. is handled inside an onSubmit handler in React. You can just add your hidden data there before sending it to the server
- If you use plain HTML form behaviour for form submission, you can add your own HTML elements by passing them as children (https://github.com/vantezzen/auto-form#adding-other-elements)
As for rendering multiple input elements in a row, its not currently possible like that, though it might be possible by using custom parent containers.
from auto-form.
Thank you for your answer !
Concerning the hidden field, as far as I understand, both of the solutions you suggest means a different schema at the client and at the server side. The one in autoform that would not include the hidden field, and the one at the server that would include it. Ideally I would use the same, but maybe I misunderstood your proposed solutions.
Also, thank you for the many input elements in a row, if you share examples, I would be very interested :)
from auto-form.
+1 these are both killer features that would make this library drastically better.
from auto-form.
Related Issues (20)
- globals.css don't work HOT 1
- Clear form input on submit HOT 3
- Conditional Logics for Forms HOT 1
- How Update existing values from defaultValues ? HOT 1
- Array values in nested object aren't loaded
- How to use with shadcn dialogue/modal? HOT 1
- Select Component eum with custom data limitation
- feature request: allow to overload the label in fieldConfig HOT 2
- Cannot load array default value HOT 2
- feature request: be able to reorder fields
- feature request: introduce fieldRender
- onChange not getting fired on any field HOT 2
- Default value priority
- Dependencies for nested fields HOT 1
- question: Is there a way to render into grid? HOT 1
- enum error
- Perhaps a support for useFormState and useFormStatus would be great HOT 2
- Zod optional field with default value become required
- disabling a field in fieldconfig
- Add value into enum
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto-form.