Skip to content

fix(TextInput): RTL for label, helper and accessories - #5221

Open
kachmashk wants to merge 1 commit into
callstack:mainfrom
kachmashk:bug/input-accessory-rtl
Open

kachmashk wants to merge 1 commit into
callstack:mainfrom
kachmashk:bug/input-accessory-rtl

Conversation

@kachmashk

Copy link
Copy Markdown
Collaborator
  • TextInput no longer swaps startAccessory and endAccessory by hand in RTL. The row already mirrors through flex direction, so the swap flipped the accessories back to the wrong side. startAccessory is always the leading slot and endAccessory is always the trailing slot. hasAccessory now depends only on startAccessory.
  • On web, RTL now uses logical properties:
    • The label wrapper is positioned with end instead of left, and with start otherwise.
    • Accessory margins are flipped through the new leadingAccessoryRTL and trailingAccessoryRTL styles.
    • Supporting text is aligned right and the counter left.
  • On native, supporting text keeps textAlign: 'left' and the counter keeps right. React Native mirrors these under RTL.
  • Tests:
    • Updated the existing RTL tree-order tests to the new behavior.
    • Added tests for label, helper, counter and accessory placement in RTL.

Motivation

In RTL layouts the TextInput label, helper text, counter and accessories were placed on the wrong side. Some were mirrored twice, and some used physical left/right values. This change places them on the correct side on native and web.

Related issue

TextInput: in RTL, startAccessory and endAccessory render on the wrong sides, and on web the label overlaps the start accessory #5214

Screenshots / Videos

android-compare ios-compare web-compare

Test plan

  1. Enable RTL, using I18nManager.forceRTL(true) on native, (you can use development builds and toggle a change in a menu drawer) and dir="rtl" on web.
  2. Open the TextInput example in both the flat and outlined modes.
  3. Check that:
    • The label starts on the right edge. It starts after the start accessory when one is present.
    • The startAccessory is on the right and the endAccessory is on the left.
    • The helper text is aligned to the right, and the counter is on the left.
  4. Switch back to LTR and confirm nothing changed.

@kachmashk kachmashk self-assigned this Nov 16, 2026
@github-actions

Copy link
Copy Markdown

Found potential problems with the pull request:

  • The description is too long. Please keep it under 1000 characters.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant