-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
[Question] Is it possible to have custom input without ref? #178
Comments
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>
</> |
I don't think a hidden field is necessary. Instead, you should wrap your custom field inside our |
@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. |
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. |
Hi! Thank you so much for such a wonderful library!
I noticed that in all the examples, ref is used to access native browser elements. But what if my input is completely custom? For example:
This is just a Boolean input for clarity. But there may be a more complex input, for example, handwritten text recognized by a neural network :)
How can such an input be integrated into the form?
Thank you in advance!
The text was updated successfully, but these errors were encountered: