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

Icon overlapping with text in text-box of Doctor's Notes. #7495 #7496

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
3 changes: 2 additions & 1 deletion src/Components/Facility/ConsultationDoctorNotes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ const ConsultationDoctorNotes = (props: ConsultationDoctorNotesProps) => {
name="note"
value={noteField}
onChange={(e) => setNoteField(e.value)}
className="grow"
className="w-full grow"
innerClassName="pr-10"
errorClassName="hidden"
placeholder="Type your Note"
disabled={!patientActive}
Expand Down
3 changes: 2 additions & 1 deletion src/Components/Facility/PatientNotesSlideover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,9 @@ export default function PatientNotesSlideover(props: PatientNotesProps) {
name="note"
value={noteField}
onChange={(e) => setNoteField(e.value)}
className="grow"
className="w-full grow"
errorClassName="hidden"
innerClassName="pr-10"
placeholder="Type your Note"
disabled={!patientActive}
onFocus={() => setFocused(true)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useRef } from "react";
import { useEffect, useRef } from "react";
import TextAreaFormField, { TextAreaFormFieldProps } from "./TextAreaFormField";

type AutoExpandingTextInputFormFieldProps = TextAreaFormFieldProps & {
Expand All @@ -9,6 +9,7 @@ const AutoExpandingTextInputFormField = (
props: AutoExpandingTextInputFormFieldProps,
) => {
const myref = useRef<HTMLTextAreaElement>(null);

useEffect(() => {
if (myref.current == null) return;
const text = myref.current.textContent?.split("\n");
Expand All @@ -24,7 +25,7 @@ const AutoExpandingTextInputFormField = (
myref.current.style.cssText = "height:" + height + "px";
});

return <TextAreaFormField ref={myref} {...props} className="w-full" />;
return <TextAreaFormField ref={myref} {...props} />;
};

export default AutoExpandingTextInputFormField;
10 changes: 7 additions & 3 deletions src/Components/Form/FormFields/TextAreaFormField.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { forwardRef } from "react";
import FormField from "./FormField";
import { FormFieldBaseProps, useFormFieldPropsResolver } from "./Utils";
import { classNames } from "../../../Utils/utils";

export type TextAreaFormFieldProps = FormFieldBaseProps<string> & {
placeholder?: string;
value?: string | number;
rows?: number;
// prefixIcon?: React.ReactNode;
// suffixIcon?: React.ReactNode;
innerClassName?: string;
onFocus?: (event: React.FocusEvent<HTMLTextAreaElement>) => void;
onBlur?: (event: React.FocusEvent<HTMLTextAreaElement>) => void;
};
Expand All @@ -30,9 +32,11 @@ const TextAreaFormField = forwardRef(
onChange={(e) => field.handleChange(e.target.value)}
placeholder={props.placeholder}
rows={rows}
className={`cui-input-base resize-none ${
field.error && "border-danger-500"
}`}
className={classNames(
"cui-input-base resize-none",
field.error && "border-danger-500",
props.innerClassName,
)}
onFocus={props.onFocus}
onBlur={props.onBlur}
/>
Expand Down
Loading