@@ -289,7 +289,7 @@ class Select extends Component {
289289 optionsNodeStyle : { height : optionsHeight } ,
290290 } = this ;
291291 const isBottomDistanceEnough = bottom + optionsHeight < this . document . documentElement . clientHeight ;
292- const isLocationTop = optionsHeight < top && ! isBottomDistanceEnough && position === 'auto' ;
292+ const isLocationTop = position === 'top' || optionsHeight < top && ! isBottomDistanceEnough && position === 'auto' ;
293293 if ( isAppendToBody ) {
294294 this . setState ( {
295295 style : {
@@ -536,6 +536,8 @@ class Select extends Component {
536536 allowClear,
537537 style,
538538 className,
539+ dropdownStyle,
540+ dropdownClassName,
539541 isAppendToBody,
540542 isSupportTitle,
541543 size,
@@ -552,9 +554,9 @@ class Select extends Component {
552554
553555 const optionContainer = open ? (
554556 < div
555- className = { `${ selector } -option-container` }
557+ className = { `${ selector } -option-container ${ dropdownClassName } ` }
556558 ref = { this . optionsNode }
557- style = { { ...popupStyle , width : `${ width } px` } }
559+ style = { { ...popupStyle , width : `${ width } px` , ... dropdownStyle } }
558560 >
559561 { this . renderOptions ( ) }
560562 </ div >
@@ -635,6 +637,9 @@ Select.propTypes = {
635637 supportUnlimited : PropTypes . bool ,
636638 unlimitedLabel : PropTypes . string ,
637639 maxTagCount : PropTypes . number ,
640+ dropdownStyle : PropTypes . object ,
641+ dropdownClassName : PropTypes . string ,
642+ position : PropTypes . oneOf ( [ 'top' , 'bottom' , 'auto' ] ) ,
638643} ;
639644
640645Select . defaultProps = {
@@ -674,6 +679,9 @@ Select.defaultProps = {
674679 supportUnlimited : false ,
675680 unlimitedLabel : '不限' ,
676681 maxTagCount : undefined ,
682+ dropdownStyle : { } ,
683+ dropdownClassName : '' ,
684+ position : 'bottom' ,
677685} ;
678686
679687export default Select ;
0 commit comments