Skip to content

Commit

Permalink
[FIX] Improve readability for larger messages entered into chat input (
Browse files Browse the repository at this point in the history
…#1410)

* increase max height of chat input for larger messages

* allow resize of input on mobile up to 50vh

* remove duplicate css rule

---------

Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
  • Loading branch information
shatfield4 and timothycarambat committed May 16, 2024
1 parent 87b41a6 commit 381bdf0
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import SlashCommandsButton, {
SlashCommands,
useSlashCommands,
} from "./SlashCommands";
import { isMobile } from "react-device-detect";
import debounce from "lodash.debounce";
import { PaperPlaneRight } from "@phosphor-icons/react";
import StopGenerationButton from "./StopGenerationButton";
Expand Down Expand Up @@ -83,7 +82,6 @@ export default function PromptInput({
};

const adjustTextArea = (event) => {
if (isMobile) return false;
const element = event.target;
element.style.height = "auto";
element.style.height = `${element.scrollHeight}px`;
Expand Down Expand Up @@ -130,7 +128,7 @@ export default function PromptInput({
adjustTextArea(e);
}}
value={promptInput}
className="cursor-text max-h-[100px] md:min-h-[40px] mx-2 md:mx-0 py-2 w-full text-[16px] md:text-md text-white bg-transparent placeholder:text-white/60 resize-none active:outline-none focus:outline-none flex-grow"
className="cursor-text max-h-[50vh] md:max-h-[350px] md:min-h-[40px] mx-2 md:mx-0 py-2 w-full text-[16px] md:text-md text-white bg-transparent placeholder:text-white/60 resize-none active:outline-none focus:outline-none flex-grow"
placeholder={"Send a message"}
/>
{buttonDisabled ? (
Expand Down

0 comments on commit 381bdf0

Please sign in to comment.