Skip to content

Support Missing name prop for <Select> #790

Closed
@cliffordfajardo

Description

@cliffordfajardo

Hi team,

Reproduction link (click button below)

Demo Bug on CodeSandbox

Summary

Allow name prop to be passed to <Select>

What is the bug?

You cannot pass name prop to <Select>
CleanShot 2022-07-13 at 10 57 53@2x

Stackblitz code example: https://stackblitz.com/edit/react-ts-zfrvws?file=App.tsx

Motivation for Change

  • maintain consistency with <Input>( https://github.com/react-component/input) which supports passing name prop, which allows follows standard HTML behavior/expectations
    ✅  <Input name="some_value" />.     // input from https://github.com/react-component/input
    ✅  <input name="some_value" />     // regular input
    
  • keep consistency with HTML standard, as <select> is allowed to have a name attribute (Specification docs)
    ❌ <Select name="some_value" />.     // select from https://github.com/react-component/select
    ✅ <select name="some_value" />     // regular input element
    

What is the expected behavior?

  1. You should be able to pass name prop to <Select> element. The name name prop, should get passed down to the input element that gets rendered in the DOM.
      • i think we need to modify Input.tsx file so the name prop that is passed into <Select> gets passed down to <Input>?

Related

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