One solution that has worked for me is adding the style white-space: normal;
to the textarea because at times it is not feasible to eliminate all the whitespace (for example when you want your code to abide to your coding guidelines which requires adding tabs, whitespaces and line breaks)
Please note that the default for textarea, at least in chrome is:
white-space: pre-wrap;