Closed kinke closed 5 years ago
Thank you for this! I was checking this part of codebase via https://github.com/webscopeio/react-textarea-autocomplete/issues/129 and I have seen this particular issue as well. I just haven't got time to revisit it - still on my TODO. The default API version with textAreaComponent
was working though so I gave it a lower priority.
You rock! 💪
P.S: Are you able to fix Flow issues? 🙏
(bot)
Hey! Thank you so much for your PR! I can see that everything is green 👏.
Here is the playground for this revision 🚀
I hope everything is fine! ❤️
Thx - I hacked around the flow issues; fixing those properly would mean a lot more work. ;)
Agree. The Flow is super old and rusty in this project. This gonna be a lot of work to make it shiny.
Released as 4.2.4 🚀 Thanks!
Oh wow, thanks a lot! :+1:
Hi @kinke, Your first post snippet has ref: 'inputRef'
. Do you suppose ref: 'innerRef'
instead? If so, could you create fix edition
Nope, inputRef
is intended and specific to react-textarea-autosize.
An confusion appears with these textareas. Also react-autosize-textarea exists but innerRef
is intended to it. And with these packages names and usages mostly no noticeable differences. This confisions leads to hardly detectable problems although there is nothing special to fix.
I tried using the react-textarea-autosize component via
and it failed, as the callback is firstly invoked correctly for its
inputRef
, but later also for itsref
, so thattextareaRef
points to theTextarea
element instead of the DOM textarea. Also make sure theinnerRef
prop is invoked with the DOM textarea, and don't use a fresh lambda for each render (which causes the previous lambda to be invoked with nil before invoking the new one with the DOM element).