📝 feat: Improved Textarea Functionality (#1942)

* feat: paste plain text from apps with rich paste data, improved edit message textarea, improved height resizing for long text

* feat(EditMessage): autofocus

* chore: retain user text color when entering edit mode
This commit is contained in:
Danny Avila 2024-03-01 12:46:15 -05:00 committed by GitHub
parent de0cee3f56
commit c52ea9490b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 91 additions and 36 deletions

View file

@ -21,7 +21,7 @@ export default function Textarea({
select: (data) => mergeFileConfig(data),
});
const {
inputRef,
textAreaRef,
handlePaste,
handleKeyUp,
handleKeyDown,
@ -31,7 +31,7 @@ export default function Textarea({
const endpointFileConfig = fileConfig.endpoints[endpoint ?? ''];
return (
<TextareaAutosize
ref={inputRef}
ref={textAreaRef}
autoFocus
value={value}
disabled={!!disabled}
@ -52,7 +52,7 @@ export default function Textarea({
: 'pl-3 md:pl-4',
'm-0 w-full resize-none border-0 bg-transparent py-[10px] pr-10 placeholder-black/50 focus:ring-0 focus-visible:ring-0 dark:bg-transparent dark:placeholder-white/50 md:py-3.5 md:pr-12 ',
removeFocusOutlines,
'max-h-52',
'max-h-[65vh] md:max-h-[85vh]',
)}
/>
);