-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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(input, textarea): dir is inherited to native form control #30102
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@brandyscarney could you please review this PR? |
Hey @mehran-prs, thank you for the PR! Is there an associated issue that this resolves or a code example where I can see what it fixes? |
Hey @brandyscarney, Thanks for your reply. <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): We can fix it using <textarea dir="auto"></textarea> Result: |
@brandyscarney could you please check my answer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this using the following code and confirmed it is changing the text direction properly now:
<ion-input dir="auto" value="דת מיזמי בדפים משחקים."></ion-input>
<ion-input dir="rtl" value="דת מיזמי בדפים משחקים."></ion-input>
<ion-input dir="auto" value="This is a input"></ion-input>
<ion-textarea dir="auto" value="דת מיזמי בדפים משחקים."></ion-textarea>
<ion-textarea dir="rtl" value="דת מיזמי בדפים משחקים."></ion-textarea>
<ion-textarea dir="auto" value="This is a textarea"></ion-textarea>
Thank you for the PR @mehran-prs!
@mehran-prs Congrats for your first PR with us! This feature will be released soon! |
Issue number: resolves #30193 resolves #29577
What is the current behavior?
The
dir
attribute is not inherited by the inner form control. Developers need control over this attribute to provide important context to users, such as text direction.What is the new behavior?
The
dir
attribute is a global attribute, so adding it as a property can cause issues. However, developers can still set it as an attribute, and it will be inherited by the native form control element. We also watch it, so any changes to the attribute will be inherited by the native form control.Does this introduce a breaking change?