Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add 'dir' as an inherited attribute to textareas and text inputs. #30193

Open
3 tasks done
mehran-prs opened this issue Feb 16, 2025 · 0 comments
Open
3 tasks done
Labels

Comments

@mehran-prs
Copy link

Prerequisites

Describe the Feature Request

Adding dir to a textarea or text input. (see PR #30102 )

Describe the Use Case

It fixes the cursor position when you type in RTL languages on phones (tested on iPhone)
Let's say you have a native textarea without dir attribute (default value is ltr):

      <textarea></textarea>

when you type using RTL characters, your cursor position remains at the beginning (because of the default LTR value, it knows that the cursor should be at the right side of the text, but in RTL languages, it's wrong and should be at the left side):
IMG_4414

We can fix it using dir attribute on it:

 <textarea dir="auto"></textarea>

Result:

IMG_4415

Describe Preferred Solution

Adding dir to a textarea or text input as an inherited attribute.

Describe Alternatives

No response

Related Code

I've created PR #30102 to add dir attribute as an inherited attr to textarea and text inputs.

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant