'right-aligned textarea's cursor placement following whitespace
I have a textarea with right-aligned text, and if the cursor is at the end of a line and whitespace is added, the whitespace shows up as expected, however the cursor remains adjacent to the previous non-whitespace character.
Is there anyway to make the cursor appear after newly entered whitespace in this context (like it does when the textarea is left-aligned)?
textarea {
text-align: right;
}
<textarea></textarea>
Solution 1:[1]
you need to specify white-space inside an element. I.E
textarea {
text-align: right;
white-space: nowrap;
}
<textarea></textarea>
Solution 2:[2]
I think you're looking for the dir="rtl" attribute:
<textarea dir="rtl"></textarea>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Abdul Malik |
| Solution 2 | Rani Giterman |
