Skip to content

Remove "valueField" "textField" etc from input components #2939

@VividLemon

Description

@VividLemon

Clear and concise description of the problem

The design of these are simple. "valueField" "textField" "disabledField" all are the result of a simplistic JS runtime structure. They can simply match items in the array of objects.

This however has typescript drawbacks, and opens up to runtime errors while not having a significant reason for its existence. People simply need to preprocess their data beforehand, simply using computed with Array.map. So on the user side, it's a simple, but adds boilerplate. The main benefit is making it less prone to errors.

Suggested solution

We remove those dynamic fields and require an exact structure. We remove our excess resolving as we would know, for certain, about various options existence.

Alternative

Continue the way it is and be less type safe. Truth is, the few input components that inherit these props and their resolution, are among the only few components that behave like that. Most components are pretty type safe in their structure, which begs the question on why these ones aren't built with safety in mind.

Additional context

@xvaara @dwgray What do you think? I prefer safety.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions