Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore/SOF-6955 #32

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/mui/components/select/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable react/jsx-props-no-spreading */
import Box from "@mui/material/Box";
import Chip from "@mui/material/Chip";
import FormControl from "@mui/material/FormControl";
import FormControl, { FormControlProps } from "@mui/material/FormControl";
import InputLabel from "@mui/material/InputLabel";
import MenuItem from "@mui/material/MenuItem";
import Select, { SelectChangeEvent } from "@mui/material/Select";
Expand All @@ -20,6 +21,7 @@ export interface SelectProps {
isChips?: boolean;
onDelete?: (event: string) => void;
getChipLabel?: (value: string) => string;
formControlProps: FormControlProps;
}
export default function SelectComponent({
id,
Expand All @@ -33,6 +35,7 @@ export default function SelectComponent({
sx = {},
fontSize = 16,
getChipLabel = (value) => value,
formControlProps = {},
}: SelectProps) {
const renderValue = isChips
? (selected: string[]) => (
Expand All @@ -59,7 +62,7 @@ export default function SelectComponent({
: undefined;

return (
<FormControl sx={{ marginY: 1, width: "100%" }}>
<FormControl sx={{ marginY: 1, width: "100%" }} {...formControlProps}>
{label ? (
<InputLabel id={`${id}-label`} sx={{ fontSize }}>
{label}
Expand Down
Loading