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

fix: replace Input with Textarea in TextAreaComponent for improved user experience and aesthetics #3228

Merged
merged 4 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
9 changes: 5 additions & 4 deletions src/frontend/src/components/textAreaComponent/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { classNames } from "@/utils/utils";
import { useEffect, useState } from "react";
import { useEffect } from "react";
import { EDIT_TEXT_MODAL_TITLE } from "../../constants/constants";
import { TypeModal } from "../../constants/enums";
import GenericModal from "../../modals/genericModal";
import { Case } from "../../shared/components/caseComponent";
import { TextAreaComponentType } from "../../types/components";
import IconComponent from "../genericIconComponent";
import { Button } from "../ui/button";
import { Input } from "../ui/input";
import { Textarea } from "../ui/textarea";

export default function TextAreaComponent({
value,
Expand All @@ -28,7 +27,7 @@ export default function TextAreaComponent({
return (
<div className={"flex w-full items-center" + (disabled ? "" : "")}>
<div className="flex w-full items-center gap-3" data-testid={"div-" + id}>
<Input
<Textarea
id={id}
data-testid={id}
value={value}
Expand All @@ -40,7 +39,9 @@ export default function TextAreaComponent({
editNode ? "input-edit-node" : "",
password != undefined ? "pr-8" : "",
"w-full",
"resize-none",
)}
rows={3}
placeholder={"Type something..."}
onChange={(event) => {
onChange(event.target.value);
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/components/ui/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
<div className="h-full w-full">
<textarea
className={cn(
"nopan nodelete nodrag noflow textarea-primary",
"nopan nodelete nodrag noflow textarea-primary nowheel",
className,
password ? "password" : "",
)}
Expand Down
Loading