Skip to content

Commit e50fb50

Browse files
fixed in test & removed type error, have to fix value type
1 parent ac7d430 commit e50fb50

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/mui-material/src/Select/Select.d.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import { FilledInputProps } from '../FilledInput';
1010

1111
export { SelectChangeEvent };
1212

13-
export interface BaseSelectProps<Value> {
13+
export interface BaseSelectProps<Value = unknown>
14+
extends StandardProps<InputProps, 'value' | 'onChange'> {
1415
/**
1516
* If `true`, the width of the popover will automatically be set according to the items inside the
1617
* menu, otherwise it will be at least the width of the select input.
@@ -150,24 +151,23 @@ export interface BaseSelectProps<Value> {
150151
variant?: 'filled' | 'standard' | 'outlined';
151152
}
152153

153-
export interface FilledSelectProps extends StandardProps<FilledInputProps, 'value' | 'onChange'> {
154+
export interface FilledSelectProps extends Omit<FilledInputProps, 'value' | 'onChange'> {
154155
/**
155156
* The variant to use.
156157
* @default 'outlined'
157158
*/
158159
variant: 'filled';
159160
}
160161

161-
export interface StandardSelectProps extends StandardProps<InputProps, 'value' | 'onChange'> {
162+
export interface StandardSelectProps extends Omit<InputProps, 'value' | 'onChange'> {
162163
/**
163164
* The variant to use.
164165
* @default 'outlined'
165166
*/
166167
variant: 'standard';
167168
}
168169

169-
export interface OutlinedSelectProps
170-
extends StandardProps<OutlinedInputProps, 'value' | 'onChange'> {
170+
export interface OutlinedSelectProps extends Omit<OutlinedInputProps, 'value' | 'onChange'> {
171171
/**
172172
* The variant to use.
173173
* @default 'outlined'
@@ -179,7 +179,7 @@ export type SelectVariants = 'outlined' | 'standard' | 'filled';
179179

180180
export type SelectProps<
181181
Value = unknown,
182-
Variant extends SelectVariants = 'outlined',
182+
Variant extends SelectVariants = SelectVariants,
183183
> = BaseSelectProps<Value> &
184184
(Variant extends 'filled'
185185
? FilledSelectProps

packages/mui-material/src/Select/Select.spec.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function genericValueTest() {
4444
<Select notched />;
4545

4646
// disabledUnderline prop should be available (inherited from InputProps) and NOT throw typescript error
47-
<Select variant="standard" disableUnderline />;
47+
<Select disableUnderline />;
4848

4949
// Tests presence of `root` class in SelectClasses
5050
const theme = createTheme({

0 commit comments

Comments
 (0)