Andarist / react-textarea-autosize

<textarea /> component for React which grows with content

Home Page:http://andarist.github.io/react-textarea-autosize/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for elements besides textarea

LandonSchropp opened this issue · comments

This might be a little out there, but I'm trying to build a component that behaves exactly like an autosizing textarea, but is not a <textarea>. I need to create a <div> with contenteditable set so I can use child elements in my editable area.

It'd be awesome if TextareaAutosize could support an optional tag property that allows the tag to be set, and defaults to textarea.

Thanks!

My intuition tells me that this would add some complexity to the internal implementation of this package and as such, this is rather a no-go on my side. Unless you would prepare a PR for this that would only adjust the implementation slightly - then I could consider merging this in.

That's totally fair. I opened #323 as a draft PR to see what it would look like. This is my first time using a contentEditable div, and I've heard that they can be finicky, so I'm not sure if this is going to be the best approach for my project yet. I may end up using something like react-contenteditable to avoid any issues in advance.