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

When field have same name but different input type its causing error #5

Open
imejis opened this issue Jun 16, 2023 · 12 comments
Open

Comments

@imejis
Copy link

imejis commented Jun 16, 2023

No description provided.

@imejis
Copy link
Author

imejis commented Jun 16, 2023

sample form

https://dorf.vercel.app/f/hvkfWSa

@Jontes-Tech
Copy link

I'm working on a fix, would this approach be bad to do?

  const processedForm = {
    ...form,
    fields: form.fields.map((field) => ({
      ...field,
      id: `${field.id}-${field.type}`,
    })),
  }

  return (
    <div>
      <div className="space-y-8">
        <TypographyH1>{form.title}</TypographyH1>
        <TypographyLead>{form.description}</TypographyLead>
      </div>
      <Separator className="mb-8 mt-4" />
      <FormRenderer form={processedForm} />
    </div>
  )

However, I'm currently working on replicating production for dev, do I need Vercel KV to run locally or is that just caching? @matheins?

@imejis
Copy link
Author

imejis commented Jun 17, 2023

I think assigning id (uuid) to the field when designing the form will be more appropriate.
You can update value for that field's values by id while filling the form.

@imejis
Copy link
Author

imejis commented Jun 17, 2023 via email

@matheins
Copy link
Owner

@Jontes-Tech using the id to make the fields name unique makes absolute sense to me.

@matheins
Copy link
Owner

@Jontes-Tech actually using kv store from vercel is required. I think making it optional for local dev environment would make sense. Its used for rate limiting.

@imejis
Copy link
Author

imejis commented Jun 17, 2023 via email

@Jontes-Tech
Copy link

@Jontes-Tech using the id to make the fields name unique makes absolute sense to me.

Yeah, we just can't display the randomness. Just use it for the programmatical things

@matheins
Copy link
Owner

matheins commented Jun 18, 2023

@Jontes-Tech I just added a small step-by-step description in README on how to setup the project locally. Please let me know if you need further assistance or if sth is not clear.

@Jontes-Tech
Copy link

I'm working on reporting this scammer

@phlezk
Copy link

phlezk commented Jan 1, 2024

I'm confused as to how my name even showed up there, lol. This scammer must be checking out who has "starred" a git/project. That's literally my only activity on this website, other than maybe a handful of comments, only.

@Jontes-Tech
Copy link

It's not even a crypto-related project :)

Repository owner deleted a comment from tim-tepia Mar 18, 2024
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

4 participants