Skip to content

Conversation

@O2sa
Copy link
Contributor

@O2sa O2sa commented Jan 23, 2026

Related Issue

Closes #19312

Description

This PR fixes the column reordering logic when the document direction is RTL.

The Problem:
The onColumnDragEnter method calculated dropPosition based solely on LTR assumptions:

  • pageX > columnCenter (Right Half) always meant dropPosition = 1 (After).
  • In RTL, the "Next" logical slot is to the left, and the "Previous" slot is to the right.

The Fix:

  1. Added detection for getComputedStyle().direction === 'rtl'.
  2. Inverted the dropPosition logic in RTL:
    • Right Half: Now sets dropPosition = -1 (Before).
    • Left Half: Now sets dropPosition = 1 (After).
  3. Adjusted the arrow indicator (reorderIndicatorUp/Down) positioning:
    • Correctly calculates style.left based on the physical edge (Left vs. Right) corresponding to the logical "Before/After" position in the current text direction.

Scope

  • Modified Component: Table (specifically onColumnDragEnter).
  • Breaking Changes: No.
  • Behavioral Changes:
    • RTL: Drag-and-drop reordering now intuitively matches the visual cursor position.
    • LTR: No change to existing behavior.

Visual Proof / Reproduction

Tested in RTL mode:

  • Dragging a column to the right side of a target now correctly shows the indicator on the right edge (Before).
  • Dragging a column to the left side of a target now correctly shows the indicator on the left edge (After).
@vercel
Copy link

vercel bot commented Jan 23, 2026

@O2sa is attempting to deploy a commit to the cetincakiroglu's projects Team on Vercel.

A member of the Team first needs to authorize it.

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

Labels

None yet

1 participant