react-textarea-autosize
react-textarea-autosize copied to clipboard
Specific content length leads to unintended behavior after load
Version: latest
https://codesandbox.io/s/lxqqw4k9rq
This example shows a use of the textarea where it should extend from 1 to 2 lines before showing a scrollbar. The predefined given content however leads to a situation where the textarea already shows a scrollbar after load instead of extending to a new line. Editing the value shows that it extends correctly if you add a few more characters and that it would even fit on one line.
I thing it has something to do with the length of the content with consideration about the style (since it effects the length).
Could u specify ur OS & browser? A gif presenting what do you see would be also helpful.
I can't reproduce on my machine.
@Andarist Sorry forgot to mention it. The Bug appears in Win10 as shown in the gif in:
- Chrome
- Edge
- IE
It renders in one line in FireFox however the line is still slightly scrollable.
I was getting unexpected overflow behavior (scrollbars showing up "sometimes". I was able to get the behavior I wanted with style={{overflow: 'hidden', }}. Hopefully that works for you.
@s4l4x Thanks that works. However this is only a viable solution if you do not use the max-row prop.
Otherwise overflow: hidden;
also hides the scrollbar when textarea-autosize reaches the max row cap which prevents further line (and content) from being shown.
Unfortunately I had no time to investigate this and I'm not sure when I will be able to do so, I'd appreciate any help with fixing this appropriately.