From acf9fb2a663ca6a86563d28821d77ab91015789c Mon Sep 17 00:00:00 2001 From: Adpearance Date: Thu, 21 Feb 2019 08:33:56 -0800 Subject: [PATCH] Fix to pass name attribute to component Allows name attribute to be set correctly, following the same method as other Input elements. --- src/select/Select.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/select/Select.jsx b/src/select/Select.jsx index eb1b8f16d..97b5f2898 100644 --- a/src/select/Select.jsx +++ b/src/select/Select.jsx @@ -34,6 +34,7 @@ type State = { cachedPlaceHolder: string, currentPlaceholder: string, selectedLabel: string, + name: string, value: any, visible: boolean, query: string, @@ -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, @@ -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} @@ -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,