Skip to content

Commit

Permalink
"name" prop was being assigned to the wrong element (div, not select)
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurakay committed Dec 2, 2016
1 parent 461a4c8 commit 78cad43
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/react/select.jsx
Expand Up @@ -53,6 +53,7 @@ class Select extends React.Component {
static propTypes = {
label: PropTypes.string,
value: PropTypes.string,
name: PropTypes.string,
defaultValue: PropTypes.string,
readOnly: PropTypes.bool,
useDefault: PropTypes.bool,
Expand All @@ -63,6 +64,7 @@ class Select extends React.Component {

static defaultProps = {
className: '',
name: '',
readOnly: false,
useDefault: (typeof document !== 'undefined' && 'ontouchstart' in document.documentElement) ? true : false,
onChange: null,
Expand Down Expand Up @@ -196,7 +198,7 @@ class Select extends React.Component {
}

const { children, className, style, label, defaultValue, readOnly,
useDefault, ...reactProps } = this.props;
useDefault, name, ...reactProps } = this.props;

return (
<div
Expand All @@ -210,6 +212,7 @@ class Select extends React.Component {
>
<select
ref="selectEl"
name={name}
tabIndex={tabIndexInner}
value={this.state.value}
defaultValue={defaultValue}
Expand Down

0 comments on commit 78cad43

Please sign in to comment.