Comments (5)
Thanks for creating this issue! In this case just ignore the provided props
of the Field
component and use setValue
instead.
from modular-forms.
FWIW, if you do not have an input, calling setValue will not update the formStore values. Wasted a bit of time trying to figure that out haha.
To resolve, I'm currently using hidden inputs.
<>
<CustomInput
field1={getValue(form, 'field1')}
field2={getValue(form, 'field2')}
onField1={v => setValue(form, 'field1', v)}
onField2={v => setValue(form, 'field2', v)}
/>
<Form.Field name="field1">{createHiddenInput}</Form.Field>
<Form.Field name="field2">{createHiddenInput}</Form.Field>
</>
from modular-forms.
I don't think a hidden field is necessary. Instead, you should wrap your custom field inside our <Field />
component because it manages the lifecycle of the field.
from modular-forms.
@fabian-hiller, this custom input sets 2 values in the form. I attempted to double wrap the Field component, and that did not appear to work.
from modular-forms.
Okay. That would be exactly the approach I would take, but I am not currently deep enough into Modular Forms to know directly why it might not work in your case.
from modular-forms.
Related Issues (20)
- FieldValue does not accept bigint HOT 1
- Modularize the Form onSubmit method HOT 5
- Setting initial error state for a form field HOT 1
- [solidjs][typescript] Getting typing right in the LoginForm example HOT 6
- valiForm error HOT 1
- Local Date Input from UTC Date HOT 16
- Typescript Errors HOT 6
- Using SolidJS ref for custom component HOT 6
- Optional alternate behaviour for revalidateOn HOT 3
- toPhoneNumber tranform example allows alpha characters HOT 3
- Field onChange event HOT 9
- Dollar Input fixed to 2 decimal points HOT 3
- Better kobalte RadioGroup example attached here; fixes bug HOT 1
- [solidjs] How to use createResource or createAsync to load default values HOT 7
- [solidjs] Conditional validation HOT 6
- Duplicate key "checked" in object literal: <input type="checkbox" checked={field.value} /> HOT 3
- [Qwik] Zod async validation doesn't work HOT 3
- initialValues of createFormStore should accept undefined if exactOptionalPropertyTypes is enabled HOT 5
- Unable to build Qwik City app HOT 2
- [Types] Form onSubmit is mandatory on every package after latest release HOT 5
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 modular-forms.