@@ -76,26 +76,19 @@ function genericValueTest() {
7676 } }
7777 /> ;
7878
79- // @ts -expect-error
80- < Select < number , 'filled' > /> ;
81- // @ts -expect-error
82- < Select < number , 'standard' > /> ;
83- // @ts -expect-error
84- < Select < number , 'standard' > variant = "filled" /> ;
85- // @ts -expect-error
86- < Select < number , 'filled' > variant = "standard" /> ;
87-
88- < Select < number , 'outlined' > /> ;
89-
90- < Select < number , 'filled' > variant = "filled" /> ;
91- < Select < number , 'outlined' > variant = "outlined" /> ;
92- < Select < number , 'standard' > variant = "standard" /> ;
93-
9479 < Select variant = "filled" /> ;
9580 < Select variant = "standard" /> ;
9681 < Select variant = "outlined" /> ;
9782 < Select /> ;
9883
84+ < Select variant = "filled" hiddenLabel /> ;
85+ // @ts -expect-error hiddenLabel is not present in standard variant
86+ < Select variant = "standard" hiddenLabel /> ;
87+ // @ts -expect-error hiddenLabel is not present in outlined variant
88+ < Select variant = "outlined" hiddenLabel /> ;
89+ // @ts -expect-error hiddenLabel is not present in outlined variant
90+ < Select hiddenLabel /> ;
91+
9992 const defaultProps : SelectProps < number > = { } ;
10093 const outlinedProps : SelectProps < number > = {
10194 variant : 'outlined' ,
@@ -113,13 +106,7 @@ function genericValueTest() {
113106 < Select { ...standardProps } /> ;
114107 < Select < number > { ...outlinedProps } /> ;
115108 < Select < number > { ...defaultProps } /> ;
116- < Select < number , 'standard' > { ...standardProps } /> ;
117- // @ts -expect-error variant type mismatch
118109 < Select < number > { ...filledProps } /> ;
119- // @ts -expect-error variant type mismatch
120- < Select < number , 'outlined' > { ...filledProps } /> ;
121- // @ts -expect-error variant type mismatch
122- < Select < number , 'standard' > { ...filledProps } /> ;
123110
124111 const rawDefaultProps : SelectProps = { } ;
125112 const rawOutlinedProps : SelectProps = {
@@ -140,6 +127,23 @@ function genericValueTest() {
140127 < Select { ...filledProps } hiddenLabel /> ;
141128 // @ts -expect-error hiddenLabel is not present in standard variant
142129 < Select { ...standardProps } hiddenLabel /> ;
130+
131+ interface OtherProps {
132+ otherProp ?: number ;
133+ }
134+
135+ const SelectWrapper1 = < Value = unknown , > ( props : SelectProps < Value > & OtherProps ) => {
136+ const { otherProp, ...materialSelectProps } = props ;
137+
138+ return (
139+ // how to solve this:
140+ < Select < Value > { ...materialSelectProps } />
141+ ) ;
142+ } ;
143+
144+ < SelectWrapper1 /> ;
145+ < SelectWrapper1 < number > variant = "filled" hiddenLabel /> ;
146+ < SelectWrapper1 variant = "filled" hiddenLabel /> ;
143147}
144148
145149type Options < T > = { text : string ; value : T } | T ;
0 commit comments