Skip to content

Tabs indicator is mispositioned in RTL layouts #334

@zollipaul

Description

@zollipaul

Before submitting a new issue

  • I tested using the latest version of the library, as the bug might be already fixed.
  • I tested using a supported version of react native.
  • I checked for possible duplicate issues, with possible answers.

Bug summary

Actual behavior

In RTL, the selected indicator does not stay aligned with the active tab.

In my case, the white selected-pill indicator moves too far to the right and can partially or fully leave the visible tab list after pressing a tab.

The current behavior also appears to assume LTR geometry for scrollable tabs.

Expected behavior

The indicator should stay aligned with the active tab and animate correctly in both LTR and RTL layouts.

Likely root cause

The Tabs indicator logic appears to assume LTR coordinates.

Library version

heroui-native@1.0.0-rc.4

Environment info

- React Native: `0.83.2`
- React: `19.2.4`
- RTL locale: Arabic
- Also reproducible by forcing RTL with `I18nManager.forceRTL(true)`

Steps to reproduce

Reproduction

  1. Enable RTL with I18nManager.forceRTL(true) or run the app in an RTL locale such as Arabic.
  2. Render a basic tabs setup:
<Tabs value={value} onValueChange={setValue}>
  <Tabs.List>
    <Tabs.Indicator />
    <Tabs.Trigger value="one">
      <Tabs.Label>One</Tabs.Label>
    </Tabs.Trigger>
    <Tabs.Trigger value="two">
      <Tabs.Label>Two</Tabs.Label>
    </Tabs.Trigger>
  </Tabs.List>
</Tabs>
  1. Press different tabs.

Reproducible example repository

see above

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions