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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[valibot 馃]: Cannot conditionally require a field without freezing web page #628

Open
demarchenac opened this issue Sep 5, 2023 · 2 comments

Comments

@demarchenac
Copy link

Describe the bug

As the title states, I'm just trying to conditionally require a field via the object() pipeline with valibot. I just so happens that the web page freezes when doing so.

To Reproduce

It's easy to reproduce since I have a working example on StackBlitz.

Basically, the way to trigger this bug is to modify the Required Input whenever any of the other three inputs doesn't have a value, if I were to fill those three up, modifying the Required Input doesn't freeze the web view.

Expected behavior

I should be able to conditionally require a field within a form depending on other fields.

Desktop (please complete the following information):

  • OS: Win 11
  • Browser Chrome
  • Version 116.0.5845.141 (64-bit)

Additional context

I've also added up to a related issue within the valibot repo

@demarchenac demarchenac changed the title [valibot 馃]: Cannot conditional require an object field since web page freezes [valibot 馃]: Cannot conditionally require a field without freezing web page Sep 5, 2023
@irg1008
Copy link

irg1008 commented Sep 11, 2023

Happens to me as well, makes object checks like sibling field equality impossible

@demarchenac
Copy link
Author

Well, it ain't impossible, we need to create custom pipeline methods as shown in the following valibot issues:

But it's really weird that the custom pipeline method breakes the application when being used on object schemas

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

2 participants