Is it possible to replace
@raphaelhovsepyan I think it would be easier to just try it out ?
@EduardJS Of course I tried!
Just want to confirm that it's not working..
@raphaelhovsepyan Well, the answer in that case is no. This component wraps up your element in order to do it's job. And with textarea, though it can be tweaked, it is not desirable.
Why not using contentEditable ( which can be an editable div ), listen to onInput, and trigger scrollToBottom() ?
@EduardJS it's impossible to listen onChange on contentEditable div, I need controlled component in my case. There are tons of issues with contentEditable (https://github.com/facebook/react/issues/2047).
Thanks for answer!
@raphaelhovsepyan I edited my answer ( onChange -> onInput ) right after replying. You probably read the email.
I have used contentEditable in production with no issues for more than half a year. There is a repo here to ease up the issues you linked. I gave it a try few weeks ago, it has it's own issues, but most of them are fixed. I wasn't lucky enough to find it while I was working on my own.
@EduardJS thanks, will try it out!
@raphaelhovsepyan I've recently accomplished this in a VERY hack-y, cringe-worthy way.
The best part? This method also works if you practice functional programming (with Redux)
You can see how I achieved this here: https://github.com/twaffl3s/daily-todo/blob/master/src/containers/list-item.js
@internette thanks for your solution! It worked like a charm for me.
I posted my own implementation here: https://jsbin.com/qequnuzixe/edit?html,css,js,output (maybe it will help someone else)
Hi, I took @Sacret solution and improved it - the scrollbar should disappear then deleting lines or text.
https://jsbin.com/kogasalomi/1/edit?html,css,js,output
hope someone enjoys this also...
Some CSS alternative: https://codepen.io/devstreak/pen/dMYgeO
Most helpful comment
@raphaelhovsepyan I've recently accomplished this in a VERY hack-y, cringe-worthy way.
The best part? This method also works if you practice functional programming (with Redux)
You can see how I achieved this here: https://github.com/twaffl3s/daily-todo/blob/master/src/containers/list-item.js