Please note the difference of a line wrap and a line break. Example:
<!DOCTYPE html>
<html>
<body>
<form action="/action_page.php">
<textarea rows="2" cols="20" name="usrtxt" wrap="soft">
I'am only one line without line breaks. Look joe I don't break but I wrap.
</textarea>
<input type="submit">
</form>
</body>
</html>
https://jsfiddle.net/b5dtjvbo/1/
I want to know if the cursor is in the first or last line. Like at the top or bottom of the textarea.