Skip to content

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

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

Closed
3 tasks done
mehran-prs opened this issue Feb 16, 2025 · 5 comments
Closed
3 tasks done
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement

Comments

@mehran-prs
Copy link
Contributor

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
@ozgurg
Copy link

ozgurg commented Mar 2, 2025

Since the dir attribute is inherited, adding dir="auto" to the parent should fix your issue.

@thetaPC
Copy link
Contributor

thetaPC commented Mar 11, 2025

Thank you for submitting this request! I have verified that the dir property doesn't work well with auto. This request will be worked on and should follow the code structure of how ion-searchbar implements it.

@thetaPC thetaPC added the type: feature request a new feature, enhancement, or improvement label Mar 11, 2025
@ionitron-bot ionitron-bot bot removed the triage label Mar 11, 2025
@thetaPC thetaPC added the package: core @ionic/core package label Mar 11, 2025
thetaPC added a commit that referenced this issue Mar 11, 2025
Issue number: resolves #30193 resolves #29577

Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
@thetaPC
Copy link
Contributor

thetaPC commented Mar 11, 2025

This has been resolved via PR #30102 and will be available in an upcoming release of Ionic.

@brandyscarney
Copy link
Member

brandyscarney commented Mar 13, 2025

Closing this as 8.5.0 has been released. 🙂 Thanks again!

Copy link

ionitron-bot bot commented Apr 12, 2025

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Apr 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement
Projects
None yet
Development

No branches or pull requests

4 participants