Skip to content

FormControl does not support custom components #1964

Closed
@Swiftwork

Description

@Swiftwork

Describe the bug
The new implementation of FormControl is stricter than FormGroup and has explicitly closed down using custom input components according to #1836 (comment). This, unfortunately, broke previously working code where we used the package wojtekmaj/react-date-picker to extend Primers library.

To Reproduce
Steps to reproduce the behavior:

  1. Implement simple form control with a custom component.
  2. Observe that the custom component is rendered first and does not get form properties bound to it as well as warnings.
<FormControl>
  <FormControl.Label>Name</FormControl.Label>
  <DatePicker/>
  <FormControl.Caption>Hint</FormControl.Caption>
</FormControl>

Expected behavior
A way to add custom form input components for use-cases where Primer does not provide one.

Screenshots
image

Desktop (please complete the following information):

  • OS: All
  • Browser All
  • Version: 35.0.0

Smartphone (please complete the following information):

  • Device: All
  • OS: All
  • Browser: All
  • Version: 35.0.0

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