@@ -11,6 +11,7 @@ import SelectButton from '../select-button';
1111import DatalistItem from '../datalist-item' ;
1212import PopperComponent from '../popper' ;
1313import SelectFieldDropdown from './SelectFieldDropdown' ;
14+ import type { Position } from '../tooltip' ;
1415import type { SelectOptionValueProp , SelectOptionProp } from './props' ;
1516import { PLACEMENT_BOTTOM_END , PLACEMENT_BOTTOM_START } from '../popper/constants' ;
1617import SearchForm from '../search-form/SearchForm' ;
@@ -47,6 +48,8 @@ type Props = {
4748 defaultValue ?: SelectOptionValueProp ,
4849 /** An optional error to show within a tooltip. */
4950 error ?: React . Node ,
51+ /** Position of error message tooltip */
52+ errorTooltipPosition ?: Position ,
5053 /* Intl object */
5154 intl : Object ,
5255 /** The select button is disabled if true */
@@ -453,7 +456,7 @@ class BaseSelectField extends React.Component<Props, State> {
453456
454457 renderSelectButton = ( ) => {
455458 const { activeItemID, isOpen } = this . state ;
456- const { buttonProps : buttonElProps , isDisabled, className, error } = this . props ;
459+ const { buttonProps : buttonElProps , isDisabled, className, error, errorTooltipPosition } = this . props ;
457460 const buttonText = this . renderButtonText ( ) ;
458461 const buttonProps = {
459462 ...buttonElProps ,
@@ -473,7 +476,7 @@ class BaseSelectField extends React.Component<Props, State> {
473476 return (
474477 // Need to store the select button reference so we can calculate the button width
475478 // in order to set it as the min width of the dropdown list
476- < SelectButton { ...buttonProps } error = { error } >
479+ < SelectButton { ...buttonProps } error = { error } errorTooltipPosition = { errorTooltipPosition } >
477480 { buttonText }
478481 </ SelectButton >
479482 ) ;
0 commit comments