Skip to content

Commit

Permalink
[Select] Add extending OutlinedInputProps by SelectProps (#31209)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrozbicki committed Mar 1, 2022
1 parent 76b7c47 commit f64fe3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/mui-material/src/Select/Select.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import { InputProps } from '../Input';
import { MenuProps } from '../Menu';
import { SelectChangeEvent, SelectInputProps } from './SelectInput';
import { SelectClasses } from './selectClasses';
import { OutlinedInputProps } from '../OutlinedInput';

export { SelectChangeEvent };

export interface SelectProps<T = unknown>
extends StandardProps<InputProps, 'value' | 'onChange'>,
Omit<OutlinedInputProps, 'value' | 'onChange'>,
Pick<SelectInputProps<T>, 'onChange'> {
/**
* If `true`, the width of the popover will automatically be set according to the items inside the
Expand Down
6 changes: 6 additions & 0 deletions packages/mui-material/src/Select/Select.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@ function genericValueTest() {
{/* Whoops. The value in onChange won't be a string */}
<MenuItem value={2} />
</Select>;

// notched prop should be available (inherited from OutlinedInputProps) and NOT throw typescript error
<Select notched />;

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

0 comments on commit f64fe3b

Please sign in to comment.