Skip to content
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

Add support for HiddenElement #313

Open
2 tasks done
tstiemerling opened this issue Sep 18, 2024 · 3 comments
Open
2 tasks done

Add support for HiddenElement #313

tstiemerling opened this issue Sep 18, 2024 · 3 comments

Comments

@tstiemerling
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Summary 💡

Would be nice to have support for HiddenElement or similar which is basically with some wrapper code so the value can be defined in the default form data and sent to the onSuccess callback along with other inputs. Right now I have to have some extra useState variables to handle this separately from the form data.

Examples 🌈

No response

@sadik-malik
Copy link
Contributor

@tstiemerling, could you clarify your use case? I'm not entirely sure which default form data you're trying to pass to the onSuccess callback.

Also, I am not in favor of adding a deprecated component like MUI Hidden to react-hook-form-mui.

@dantheother
Copy link

I believe OP is probably asking about something that helps with input type=hidden, rather than CSS hidden, which is what the MUI Hidden was all about.

I've not tried to do this myself using react hook form, nor mui, so I can't speak to what extra functionality a library could offer here.

@sadik-malik
Copy link
Contributor

Okay, then the following code can be used to register the field while keeping it hidden in the form.

<input {...register("test")} type="hidden"/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants