Skip to content

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

Closed
@mehran-prs

Description

@mehran-prs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions