Skip to content

Form Field and Input component interfaces should be more intuitive and less dependent on Form parent  #4

@curiousercreative

Description

@curiousercreative

Currently, there are three layers of components to the form library (bottom to top:

  1. The Input components (text for example) is responsible for actual user interaction with form input/control. This can be a simple <input> or it can be a complex composite component. These are managed state components where a user "change" event is handled and the managed value is passed back to the input component for rendering.
  2. The Field component wraps an Input component and is responsible for consistent form field UI (label, error messaging, state styles) and connecting to the parent form component.
  3. The Form component manages a data store for values and errors as well as validation logic, high-level rendering and various form and field lifecycle behaviors.

While our form field (input components) currently integrate with our Form component, they are not functional without a parent Form component currently. Additionally, the basic interface for these input components isn't conventional.

Both Input components and Field wrapped Input components should be refactored to use conventional onChange and value prop names and function with or without a parent Form component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions