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

Fixes text from overflowing in select menu dropdowns #7792

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/Components/Form/SelectMenuV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const SelectMenuV2 = <T, V>(props: SelectMenuProps<T, V>) => {
{value.icon}
</div>
)}
<p className="ml-2.5 whitespace-nowrap break-all text-sm font-medium">
<p className="ml-2.5 whitespace-pre-wrap text-start text-sm font-medium">
{value.selectedLabel}
</p>
</div>
Expand Down
15 changes: 8 additions & 7 deletions src/Components/Patient/PatientRegister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import CollapseV2 from "../Common/components/CollapseV2";
import ConfirmDialog from "../Common/ConfirmDialog";
import DateFormField from "../Form/FormFields/DateFormField";
import DialogModal from "../Common/Dialog";
import { DupPatientModel } from "../Facility/models";
import { DistrictModel, DupPatientModel, WardModel } from "../Facility/models";
import DuplicatePatientDialog from "../Facility/DuplicatePatientDialog";
import {
FieldError,
Expand Down Expand Up @@ -64,6 +64,7 @@ import routes from "../../Redux/api.js";
import request from "../../Utils/request/request.js";
import SelectMenuV2 from "../Form/SelectMenuV2.js";
import Checkbox from "../Common/components/CheckBox.js";
import { ILocalBodies } from "../ExternalResult/models.js";

const Loading = lazy(() => import("../Common/Loading"));
const PageTitle = lazy(() => import("../Common/PageTitle"));
Expand Down Expand Up @@ -205,9 +206,9 @@ export const PatientRegister = (props: PatientRegisterProps) => {
const [isDistrictLoading, setIsDistrictLoading] = useState(false);
const [isLocalbodyLoading, setIsLocalbodyLoading] = useState(false);
const [isWardLoading, setIsWardLoading] = useState(false);
const [districts, setDistricts] = useState<any[]>([]);
const [localBody, setLocalBody] = useState<any[]>([]);
const [ward, setWard] = useState<any[]>([]);
const [districts, setDistricts] = useState<DistrictModel[]>([]);
const [localBody, setLocalBody] = useState<ILocalBodies[]>([]);
const [ward, setWard] = useState<WardModel[]>([]);
const [ageInputType, setAgeInputType] = useState<
"date_of_birth" | "age" | "alert_for_age"
>("date_of_birth");
Expand Down Expand Up @@ -1749,9 +1750,9 @@ export const PatientRegister = (props: PatientRegisterProps) => {
}
disabled={!field("district").value}
options={localBody}
optionLabel={(o: any) => o.name}
optionValue={(o: any) => o.id}
onChange={(e: any) => {
optionLabel={(o) => o.name}
optionValue={(o) => o.id}
onChange={(e) => {
field("local_body").onChange(e);
field("ward").onChange({
name: "ward",
Expand Down
Loading