Skip to content

Commit 811816c

Browse files
ogabrielluizanovazzi1autofix-ci[bot]
authored
fix: replace Input with Textarea in TextAreaComponent for improved user experience and aesthetics (#3228)
* fix: add 'nowheel' class to Textarea component for enhanced user experience in textarea interactions * refactor: replace Input with Textarea in TextAreaComponent for improved user experience and aesthetics * refactor: Update TextAreaComponent to dynamically adjust the number of rows based on the content length for improved user experience * [autofix.ci] apply automated fixes --------- Co-authored-by: anovazzi1 <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 10af388 commit 811816c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Diff for: src/frontend/src/components/textAreaComponent/index.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { classNames } from "@/utils/utils";
2-
import { useEffect, useState } from "react";
2+
import { useEffect } from "react";
33
import { EDIT_TEXT_MODAL_TITLE } from "../../constants/constants";
44
import { TypeModal } from "../../constants/enums";
55
import GenericModal from "../../modals/genericModal";
6-
import { Case } from "../../shared/components/caseComponent";
76
import { TextAreaComponentType } from "../../types/components";
87
import IconComponent from "../genericIconComponent";
98
import { Button } from "../ui/button";
10-
import { Input } from "../ui/input";
9+
import { Textarea } from "../ui/textarea";
1110

1211
export default function TextAreaComponent({
1312
value,
@@ -28,7 +27,7 @@ export default function TextAreaComponent({
2827
return (
2928
<div className={"flex w-full items-center" + (disabled ? "" : "")}>
3029
<div className="flex w-full items-center gap-3" data-testid={"div-" + id}>
31-
<Input
30+
<Textarea
3231
id={id}
3332
data-testid={id}
3433
value={value}
@@ -40,7 +39,9 @@ export default function TextAreaComponent({
4039
editNode ? "input-edit-node" : "",
4140
password != undefined ? "pr-8" : "",
4241
"w-full",
42+
"resize-none",
4343
)}
44+
rows={Math.min(3, value.split("\n").length)}
4445
placeholder={"Type something..."}
4546
onChange={(event) => {
4647
onChange(event.target.value);

Diff for: src/frontend/src/components/ui/textarea.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
1313
<div className="h-full w-full">
1414
<textarea
1515
className={cn(
16-
"nopan nodelete nodrag noflow textarea-primary",
16+
"nopan nodelete nodrag noflow textarea-primary nowheel",
1717
className,
1818
password ? "password" : "",
1919
)}

0 commit comments

Comments
 (0)