Skip to content

Fix RTL sticky scrollbar dragging at the boundary - #1527

Open
rayw-lab wants to merge 1 commit into
react-component:masterfrom
rayw-lab:codex/rtl-sticky-scroll-endpoint
Open

rayw-lab wants to merge 1 commit into
react-component:masterfrom
rayw-lab:codex/rtl-sticky-scroll-endpoint

Conversation

@rayw-lab

@rayw-lab rayw-lab commented Nov 28, 2026 •

Copy link
Copy Markdown

What changed

Dragging an RTL sticky scrollbar straight to its far edge can leave the table where it started. The drag is clamped to the correct bound, then the scroll update is skipped at that exact coordinate.

Forward the clamped position to the table. The RTL and LTR calculations now both accept either endpoint.

Tests

  • Reproduced in Chromium by dragging from the far right directly to the left edge or past it. With the patch, the table reaches the edge and can be dragged back.
  • All nine tests in tests/Sticky.spec.jsx passed. The two new RTL assertions fail on the base revision, and the LTR controls pass.

Refs #1214.

Summary by CodeRabbit

  • Bug Fixes
    • 修复 RTL 和 LTR 布局下拖动滚动条的问题,使滚动条能够可靠地拖动至两侧端点,并在反向拖动时正确更新滚动位置。

@vercel

vercel Bot commented Nov 28, 2026

Copy link
Copy Markdown

@rayw-lab is attempting to deploy a commit to the afc163's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Sticky 滚动条在拖动期间现在会持续调用 onScroll 并更新拖动位置。新增测试覆盖 RTL 和 LTR 下的端点及反向拖动结果。

Changes

Sticky 滚动条拖动

层 / 文件 摘要
拖动处理与方向测试
src/stickyScrollBar.tsx, tests/Sticky.spec.jsx
移除 RTL 拖动时的滚动范围条件,使拖动期间持续发送滚动值并更新拖动参考位置。新增 RTL 和 LTR 下端点及反向拖动的参数化测试。

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: shaodahong, saeedjafari68

Merge Risk: Minimal · up to 94a46

The change fixes RTL sticky scrollbar dragging at the boundary and adds RTL and LTR regression tests. No actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed PR 标题“Fix RTL sticky scrollbar dragging at the boundary”与变更内容直接相关。变更修改了 src/stickyScrollBar.tsx 中 onMouseMove 的 RTL 边界检查逻辑,使拖动到可滚动范围末端时仍能更新滚动位置。新增的测试覆盖 RTL 和 LTR 下拖动到两端及反向拖动的场景,与标题描述的问题一致。标题具体,说明了受影响的…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

PR 标题“Fix RTL sticky scrollbar dragging at the boundary”与变更内容直接相关。变更修改了 src/stickyScrollBar.tsx 中 onMouseMove 的 RTL 边界检查逻辑,使拖动到可滚动范围末端时仍能更新滚动位置。新增的测试覆盖 RTL 和 LTR 下拖动到两端及反向拖动的场景,与标题描述的问题一致。标题具体,说明了受影响的组件和问题边界。

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

小兔推着滚动条,轻轻向前跑
RTL 与 LTR,都能拖到边角
到了端点再回身,位置仍有记号
测试守在一旁,把结果看牢
耳朵摇一摇,开心蹦过小青草

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 231e5ec2-c330-4f54-b9b5-d777d7f03484
Commits

Reviewing files that changed from the base of the PR and between b1ef288 and 94a4645.

Files selected for processing: 2

  • src/stickyScrollBar.tsx
  • tests/Sticky.spec.jsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant