Skip to content

Commit

Permalink
fixed in test & removed type error, have to fix value type
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulKristoffersson committed Dec 13, 2023
1 parent ac7d430 commit 096a693
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions packages/mui-material/src/Select/Select.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { FilledInputProps } from '../FilledInput';

export { SelectChangeEvent };

export interface BaseSelectProps<Value> {
export interface BaseSelectProps<Value = unknown>
extends StandardProps<InputProps, 'value' | 'onChange'>{
/**
* If `true`, the width of the popover will automatically be set according to the items inside the
* menu, otherwise it will be at least the width of the select input.
Expand Down Expand Up @@ -150,15 +151,15 @@ export interface BaseSelectProps<Value> {
variant?: 'filled' | 'standard' | 'outlined';
}

export interface FilledSelectProps extends StandardProps<FilledInputProps, 'value' | 'onChange'> {
export interface FilledSelectProps extends Omit<FilledInputProps, 'value' | 'onChange'> {
/**
* The variant to use.
* @default 'outlined'
*/
variant: 'filled';
}

export interface StandardSelectProps extends StandardProps<InputProps, 'value' | 'onChange'> {
export interface StandardSelectProps extends Omit<InputProps, 'value' | 'onChange'> {
/**
* The variant to use.
* @default 'outlined'
Expand All @@ -167,7 +168,7 @@ export interface StandardSelectProps extends StandardProps<InputProps, 'value' |
}

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

export type SelectProps<
Value = unknown,
Variant extends SelectVariants = 'outlined',
Variant extends SelectVariants =SelectVariants,
> = BaseSelectProps<Value> &
(Variant extends 'filled'
? FilledSelectProps
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/Select/Select.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function genericValueTest() {
<Select notched />;

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

// Tests presence of `root` class in SelectClasses
const theme = createTheme({
Expand Down

0 comments on commit 096a693

Please sign in to comment.