From 963e3c465cfacfdbf1c8c0209533db63b231b936 Mon Sep 17 00:00:00 2001 From: Suraj Ramchandran <30753067+Suraj-Ram@users.noreply.github.com> Date: Sun, 27 Oct 2024 16:22:20 -0400 Subject: [PATCH] Added auto resize textarea --- .../frontend/components/Sidebar/Sidebar.tsx | 32 ++++++++++- packages/frontend/package.json | 1 + yarn.lock | 55 ++++++++++++++++++- 3 files changed, 85 insertions(+), 3 deletions(-) diff --git a/packages/frontend/components/Sidebar/Sidebar.tsx b/packages/frontend/components/Sidebar/Sidebar.tsx index 96244630c..7b40367da 100644 --- a/packages/frontend/components/Sidebar/Sidebar.tsx +++ b/packages/frontend/components/Sidebar/Sidebar.tsx @@ -8,6 +8,7 @@ import { Text, Textarea, VStack, + TextareaProps, } from "@chakra-ui/react"; import { Image } from "@chakra-ui/react"; import { @@ -42,6 +43,9 @@ import { HelperToolTip } from "../Help"; import NUPathSection from "./NUPathSection"; import DropdownWarning from "./DropdownWarning"; import { NUPathEnum } from "@graduate/common"; +import { forwardRef } from "react"; + +import ResizeTextarea from "react-textarea-autosize"; export enum SidebarValidationStatus { Loading = "Loading", @@ -305,6 +309,25 @@ export const NoMajorSidebar: React.FC = ({ ); }; +// Still a bit buggy +const AutoResizeTextarea = forwardRef( + (props, ref) => { + return ( +