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

Fix to pass name attribute to Select component #937

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/select/Select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type State = {
cachedPlaceHolder: string,
currentPlaceholder: string,
selectedLabel: string,
name: string,
value: any,
visible: boolean,
query: string,
Expand Down Expand Up @@ -70,6 +71,7 @@ class Select extends Component {
cachedPlaceHolder: props.placeholder || i18n.t('el.select.placeholder'),
currentPlaceholder: props.placeholder || i18n.t('el.select.placeholder'),
selectedLabel: '',
name: props.name || '',
selectedInit: false,
visible: false,
selected: undefined,
Expand Down Expand Up @@ -889,7 +891,7 @@ class Select extends Component {
value={selectedLabel}
type="text"
placeholder={currentPlaceholder}
name="name"
name={this.state.name}
size={size}
disabled={disabled}
readOnly={!filterable || multiple}
Expand Down Expand Up @@ -956,6 +958,7 @@ Select.contextTypes = {
Select.propTypes = {
value: PropTypes.any,
size: PropTypes.string,
name: PropTypes.string,
disabled: PropTypes.bool,
clearable: PropTypes.bool,
filterable: PropTypes.bool,
Expand Down