Name: textDirection

Type: property

Syntax: set the textDirection of field to {ltr | rtl | empty}

Summary: Specifies whether the field should lay out its contents in a left-to-right or right-to-left manner.

Associations: field

Introduced: 7.0

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Example:
set the textDirection of field "name input" to "rtl"

Parameters:
direction (enum): The direction to be used to lay out the contents of a field
- "ltr": Left-to-right
- "rtl": Right-to-left
- "empty": Auto-detect based on the contents of the field.

Description:
Use the textDirection property of a field to specify how the contents of a field should be laid out.

The textDirection property of a field species how the contents of a field should be laid out.

The "ltr" direction specifies that the contents of the field are to be laid out in a left-to-right manner. Tabs and lines start at the left-hand side. Runs of RTL text will still be arranged correctly but will be aligned to the left.

The "rtl" direction specifies that the contents of the field are to be laid out in a right-to-left manner. Tabs and lines start at the right-hand side. Runs of LTR text will still be arranged correctly but will be aligned to the right.

Setting the <textDirection> property to empty indicates that the engine should auto-detect LTR or RTL behaviour based on the contents of the field. To do this, it looks for the first strongly-directional character in the field (e.g a Latin letter or an Arabic letter).

References: cursorMovement (property)
