Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Missing name prop for <Select> #790

Closed
cliffordfajardo opened this issue Jul 12, 2022 · 2 comments
Closed

Support Missing name prop for <Select> #790

cliffordfajardo opened this issue Jul 12, 2022 · 2 comments

Comments

@cliffordfajardo
Copy link

cliffordfajardo commented Jul 12, 2022

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

@cliffordfajardo cliffordfajardo changed the title Support Missing name prop for <Select> Support Missing name prop for <Select> Jul 12, 2022
@cliffordfajardo
Copy link
Author

CC @zombieJ @yiminghe @MadCcc

@cliffordfajardo
Copy link
Author

Closing this PR
I created a new Issue which more clearly demontrates the challenge here
#799

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant