How can I compose TextArea with a ScrollArea component? #1227
-
I want to compose TextArea with a ScrollArea component so that my TextArea has a custom scrollbar, how do I do it, and is it possible? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Hi @joseDaKing, unfortunately I don't think it's possible as |
Beta Was this translation helpful? Give feedback.
-
you could use |
Beta Was this translation helpful? Give feedback.
-
I'm using shadcn/ui. <ScrollArea className="box-border max-h-28 w-full rounded-lg border border-input bg-background ring-offset-background focus-within:ring-1 focus-within:ring-ring 2xl:max-h-40">
<Textarea
ref={ref}
onKeyDown={handleKeyDown}
autoFocus={autoFocus}
maxLength={maxLength}
className="box-border resize-none whitespace-pre-wrap break-words border-none bg-gray-50 pb-5 [field-sizing:content] focus:ring-0 focus:ring-offset-0"
rows={2}
value={value}
placeholder="Type your message here."
onInput={handleInput}
disabled={disabled}
/>
</ScrollArea> |
Beta Was this translation helpful? Give feedback.
you could use
contenteditable
attribute https://codesandbox.io/s/ancient-field-9ycskc?file=/App.js