66
77import { useState , useEffect , useCallback , useRef } from "react" ;
88import { observer } from "mobx-react" ;
9+ import { Field } from "@makeplane/propel/components/field" ;
10+ import { TextArea , TextAreaGroup } from "@makeplane/propel/components/text-area" ;
911import { useTranslation } from "@plane/i18n" ;
1012import type { TNameDescriptionLoader } from "@plane/types" ;
11- // components
12- import { TextArea } from "@plane/ui" ;
1313// types
1414import { cn } from "@plane/utils" ;
1515import useDebounce from "@/hooks/use-debounce" ;
@@ -39,7 +39,6 @@ export const IssueTitleInput = observer(function IssueTitleInput(props: IssueTit
3939 issueId,
4040 issueOperations,
4141 projectId,
42- className,
4342 containerClassName,
4443 } = props ;
4544 const { t } = useTranslation ( ) ;
@@ -132,7 +131,7 @@ export const IssueTitleInput = observer(function IssueTitleInput(props: IssueTit
132131 ) ;
133132
134133 const handleTitleChange = useCallback (
135- ( e : React . ChangeEvent < HTMLTextAreaElement > ) => {
134+ ( e : React . ChangeEvent < HTMLTextAreaElement | HTMLInputElement > ) => {
136135 setIsSubmitting ( "submitting" ) ;
137136 const titleFromEvent = e . target . value ;
138137 setTitle ( titleFromEvent ) ;
@@ -147,26 +146,25 @@ export const IssueTitleInput = observer(function IssueTitleInput(props: IssueTit
147146 return (
148147 < div className = "flex flex-col gap-1.5" >
149148 < div className = { cn ( "relative" , containerClassName ) } >
150- < TextArea
151- id = "title-input"
152- className = { cn (
153- "block w-full resize-none overflow-hidden rounded-sm border-none bg-transparent px-3 py-0 text-20 font-medium ring-0 outline-none" ,
154- {
155- "mx-2.5 ring-1 ring-danger-strong" : title ?. length === 0 ,
156- } ,
157- className
158- ) }
159- disabled = { disabled }
160- value = { title }
161- onChange = { handleTitleChange }
162- maxLength = { 255 }
163- placeholder = { t ( "issue.title.label" ) }
164- onFocus = { ( ) => setIsLengthVisible ( true ) }
165- onBlur = { ( ) => setIsLengthVisible ( false ) }
166- />
149+ < Field name = "title" invalid = { title ?. length === 0 } >
150+ < TextAreaGroup >
151+ < TextArea
152+ size = "2xl"
153+ surface = "field"
154+ id = "title-input"
155+ disabled = { disabled }
156+ value = { title }
157+ onChange = { handleTitleChange }
158+ maxLength = { 255 }
159+ placeholder = { t ( "issue.title.label" ) }
160+ onFocus = { ( ) => setIsLengthVisible ( true ) }
161+ onBlur = { ( ) => setIsLengthVisible ( false ) }
162+ />
163+ </ TextAreaGroup >
164+ </ Field >
167165 < div
168166 className = { cn (
169- "pointer-events-none absolute right-1 bottom-1 z-[2] rounded-sm bg-surface-1 p-0.5 text-11 text-secondary opacity-0 transition-opacity" ,
167+ "pointer-events-none absolute right-1 bottom-1 z-2 rounded-sm bg-surface-1 p-0.5 text-11 text-secondary opacity-0 transition-opacity" ,
170168 {
171169 "opacity-100" : isLengthVisible ,
172170 }
0 commit comments