Skip to content

Feature: defaultValue and value to allow primitive types #4601

@gregg-cbs

Description

@gregg-cbs

Hey,

I am voting for defaultValue and value to allow primitive types

<Select name="countryCode" defaultValue="ZA"

my reasoning

  1. It doesnt follow native select convention to pass an object as the value. Its not intuitive.
  2. Developers dont store the select value in a database as an object, the value will be stored as a primitive.
  3. If a developer wants to set the defaultValue from a stored value then they would need to filter the array of options to find the object and give that to the select - seems tedious for every developer who uses this to do that when you could do it once.
  4. If developers want the chosen object they should use an event like 'onChange' to get it.

Its a great plugin, here it is in the wild:

image

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