Skip to content

Commit

Permalink
Icon overlapping with text in text-box of Doctor's Notes. #7495 (#7496)
Browse files Browse the repository at this point in the history
* Icon overlapping with text in text-box of Doctor's Notes. #7495

* Update PatientNotesSlideover.tsx

* fixes #7495

---------

Co-authored-by: Mohammed Nihal <57055998+nihal467@users.noreply.github.com>
Co-authored-by: rithviknishad <mail@rithviknishad.dev>
  • Loading branch information
3 people committed May 7, 2024
1 parent 06eaaa8 commit 24c0ce1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
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

0 comments on commit 24c0ce1

Please sign in to comment.