diff --git a/README.md b/README.md index f33c9936b..f584db03e 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ React.render(c, container); |onDeselect | called when a option is deselected. param is option's value. only called for multiple or tags | Function(value) | - | |defaultActiveFirstOption | whether active first option by default | bool | true | |getPopupContainer | container which popup select menu rendered into | function(trigger:Node):Node | function(){return document.body;} | +|getInputElement| customize input element | function(): Element | - | ### Option props diff --git a/src/Select.jsx b/src/Select.jsx index 7829abead..fe42a85a1 100644 --- a/src/Select.jsx +++ b/src/Select.jsx @@ -77,6 +77,7 @@ const Select = React.createClass({ dropdownStyle: PropTypes.object, maxTagTextLength: PropTypes.number, tokenSeparators: PropTypes.arrayOf(PropTypes.string), + getInputElement: PropTypes.func, }, mixins: [FilterMixin], @@ -507,15 +508,19 @@ const Select = React.createClass({ getInputElement() { const props = this.props; + const inputElement = props.getInputElement ? props.getInputElement() : ; + const inputCls = classnames(inputElement.props.className, { + [`${props.prefixCls}-search__field`]: true, + }); return (