@@ -277,6 +277,8 @@ export interface Props<
277277 form ?: string ;
278278 /** Marks the value-holding input as required for form validation */
279279 required ?: boolean ;
280+ /** Data attributes to be applied to the select container */
281+ dataAttributes ?: Record < string , string > ;
280282}
281283
282284export const defaultProps = {
@@ -2202,7 +2204,7 @@ export default class Select<
22022204 const { Control, IndicatorsContainer, SelectContainer, ValueContainer } =
22032205 this . getComponents ( ) ;
22042206
2205- const { className, id, isDisabled, menuIsOpen } = this . props ;
2207+ const { className, id, isDisabled, menuIsOpen, dataAttributes } = this . props ;
22062208 const { isFocused } = this . state ;
22072209 const commonProps = ( this . commonProps = this . getCommonProps ( ) ) ;
22082210
@@ -2213,6 +2215,7 @@ export default class Select<
22132215 innerProps = { {
22142216 id : id ,
22152217 onKeyDown : this . onKeyDown ,
2218+ ...dataAttributes ,
22162219 } }
22172220 isDisabled = { isDisabled }
22182221 isFocused = { isFocused }
@@ -2251,4 +2254,7 @@ export type PublicBaseSelectProps<
22512254 Option ,
22522255 IsMulti extends boolean ,
22532256 Group extends GroupBase < Option >
2254- > = JSX . LibraryManagedAttributes < typeof Select , Props < Option , IsMulti , Group > > ;
2257+ > = JSX . LibraryManagedAttributes < typeof Select , Props < Option , IsMulti , Group > > & {
2258+ /** Data attributes to be applied to the select container */
2259+ dataAttributes ?: Record < string , string > ;
2260+ } ;
0 commit comments