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

Error: Unable to use Multiple Instances of svgUploadPreview in single document #12

Open
avcohen opened this issue Jul 20, 2021 · 0 comments · May be fixed by #16
Open

Error: Unable to use Multiple Instances of svgUploadPreview in single document #12

avcohen opened this issue Jul 20, 2021 · 0 comments · May be fixed by #16

Comments

@avcohen
Copy link

avcohen commented Jul 20, 2021

I'm attempting to use this type multiple times in a single document.

eg:

    ...,
    {
      name: "svgTop",
      title: "Top Image",
      type: "svgUploadPreview",
      description: "Used on the index page - displayed at the top",
      validation: (Rule) => Rule.required(),
    },
    {
      name: "svgBottom",
      title: "Bottom Image",
      type: "svgUploadPreview",
      description: "Used on the index page - displayed at the bottom",
      validation: (Rule) => Rule.required(),
    },
    {
      name: "svgCombined",
      title: "Combined Image",
      type: "svgUploadPreview",
      description: "Used as the header on non-index pages and within the menu.",
      validation: (Rule) => Rule.required(),
    },
    ...

It seems this causes an issue as all inputs have the same HTML name / id attribute svg-upload.

I'd be happy to open a PR but it seems like the easy fix might be replace svg-upload here with this.props.name and the htmlFor attribute on line 54.

Thanks for your work on this.

@djeglin djeglin linked a pull request Jan 20, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant