Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

react-core Select creates nested form #1197

@kahboom

Description

@kahboom

For some reason, PF wraps Select in a form element, which is causing issues, as you're not really supposed to nest forms. This doesn't happen with FormSelect, which uses a normal <select> tag, but I need to use Select because it has the isCreatable option.. it seems like it was introduced in this PR: https://github.com/patternfly/patternfly-react/pull/2820/files#diff-fd84af25e09f77329b1e8c8fd1d08914R406

If you try to use Select within a Formik form, you can get errors like this:
Warning: validateDOMNesting(...): <form> cannot appear as a descendant of <form>

I am trying this workaround for a Formik custom widget I created, but it's not going so well as we are generating forms automatically based on backend-provided values and have no control over how they get rendered: jaredpalmer/formik#826 (comment)


For feature requests or enhancements, file an issue against patternfly-design.

For bug reports, please provide as much relevant info as possible:

  • What browser(s), device and OS experience the problem? Chrome, macOS Catalina
  • Are you using a PatternFly JS framework implementation [1]? Yes, patternfly-react v3.120.8
  • What are the steps to reproduce the issue and what is the expected behavior? For the the fastest support, provide a working demo or minimal reproduction using tools such as codepen or jsfiddle

Tell us more about your product/project and timeline to help prioritize this issue.

  • What product/project does this impact? Fuse Online + Syndesis
  • List product/project release(s) and timelines. Deadline was Monday, bug fixing now
  • Is this a customer reported blocking issue? No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions