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

Show dropdown list over mui modal in FacilitySelectDialougue #3885

Merged
merged 1 commit into from
Oct 30, 2022
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
27 changes: 25 additions & 2 deletions src/Components/ExternalResult/FacilitiesSelectDialogue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ import CheckCircleOutlineIcon from "@material-ui/icons/CheckCircleOutline";
import React from "react";
import { FacilitySelect } from "../Common/FacilitySelect";
import { FacilityModel } from "../Facility/models";
import { makeStyles } from "@material-ui/core/styles";

const useStyles = makeStyles({
paperFullWidth: {
overflowY: "visible",
},
dialogContentRoot: {
overflowY: "visible",
},
});

interface Props {
handleOk: () => void;
Expand All @@ -19,6 +29,7 @@ interface Props {

const FacilitiesSelectDialog = (props: Props) => {
const { handleOk, handleCancel, selectedFacility, setSelected } = props;
const classes = useStyles();

const handleEscKeyPress = (event: any) => {
if (event.key === "Escape") {
Expand All @@ -27,21 +38,33 @@ const FacilitiesSelectDialog = (props: Props) => {
};

return (
<Dialog open={true} onKeyDown={(e) => handleEscKeyPress(e)}>
<Dialog
open={true}
fullWidth={true}
classes={{
paperFullWidth: classes.paperFullWidth,
}}
onKeyDown={(e) => handleEscKeyPress(e)}
>
<DialogTitle
className="font-semibold text-3xl max-w-md md:min-w-[400px]"
id="font-semibold text-3xl"
>
Search for a facility
</DialogTitle>
<DialogContent>
<DialogContent
classes={{
root: classes.dialogContentRoot,
}}
>
<FacilitySelect
name="facilities"
selected={selectedFacility}
setSelected={setSelected}
errors=""
showAll={false}
multiple={false}
className="z-40"
/>
</DialogContent>
<DialogActions style={{ justifyContent: "space-between" }}>
Expand Down