Skip to content

Commit 096a693

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

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

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

+6-5
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,15 +151,15 @@ 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'
@@ -167,7 +168,7 @@ export interface StandardSelectProps extends StandardProps<InputProps, 'value' |
167168
}
168169

169170
export interface OutlinedSelectProps
170-
extends StandardProps<OutlinedInputProps, 'value' | 'onChange'> {
171+
extends Omit<OutlinedInputProps, 'value' | 'onChange'> {
171172
/**
172173
* The variant to use.
173174
* @default 'outlined'
@@ -179,7 +180,7 @@ export type SelectVariants = 'outlined' | 'standard' | 'filled';
179180

180181
export type SelectProps<
181182
Value = unknown,
182-
Variant extends SelectVariants = 'outlined',
183+
Variant extends SelectVariants =SelectVariants,
183184
> = BaseSelectProps<Value> &
184185
(Variant extends 'filled'
185186
? 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)