Skip to content

feat(Tabs): add drag-to-scroll for horizontal tabs (DS-4765)#423

Merged
KamilEmeleev merged 1 commit into
mainfrom
feat/ds-4765
Jul 17, 2026
Merged

feat(Tabs): add drag-to-scroll for horizontal tabs (DS-4765)#423
KamilEmeleev merged 1 commit into
mainfrom
feat/ds-4765

Conversation

@KamilEmeleev

Copy link
Copy Markdown
Collaborator

No description provided.

@KamilEmeleev KamilEmeleev added the enhancement New feature or request label Jul 15, 2026
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 6adca96):

https://react-koobiq-next--prs-423-1fc3e15q.web.app

(expires Mon, 20 Jul 2026 17:59:07 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: fc29847d4a9e5cb1adf458c76a9b681c76e2eeff

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds mouse drag-to-scroll (with inertia) for horizontally overflowed Tabs, improving usability when many tabs don’t fit in the viewport while preserving native touch scrolling behavior.

Changes:

  • Introduces a useDragScroll hook to implement mouse drag scrolling with momentum and click suppression during drags.
  • Wires drag-scroll behavior into Tabs scroll container and exposes data-dragging for styling.
  • Updates Tab selection behavior under horizontal overflow (shouldSelectOnPressUp) and adds unit tests covering drag, selection suppression, and inertia.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/components/src/components/Tabs/Tabs.tsx Integrates drag-to-scroll into the tabs scroll box, cancels inertia on programmatic scroll, and adjusts tab press selection behavior when overflowed.
packages/components/src/components/Tabs/Tabs.test.tsx Adds test helpers and coverage for mouse-drag scrolling, non-drag cases, selection suppression during drags, and inertia behavior.
packages/components/src/components/Tabs/Tabs.module.css Adds grab/grabbing cursor styling and disables selection while dragging when horizontally scrollable.
packages/components/src/components/Tabs/hooks/useDragScroll.ts New hook implementing mouse-only drag-to-scroll with inertia and click suppression.
packages/components/src/components/Tabs/hooks/index.ts Exports the new useDragScroll hook.
packages/components/src/components/Tabs/components/Tab/Tab.tsx Adds shouldSelectOnPressUp support and forwards it into useTab.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@KamilEmeleev
KamilEmeleev requested a review from rmnturov July 16, 2026 09:25
@rmnturov

Copy link
Copy Markdown

Круто) Давай инерцию добавим на драг-скролл
https://codepen.io/rmnturov/full/myRKrKP

@rmnturov

Copy link
Copy Markdown

Я смотрел пример editable и там не было инерции при скролле
Ожидаю, что инерция будет везде по умолчанию при скролле
image
https://react-koobiq-next--prs-423-1fc3e15q.web.app/iframe?id=components-tabs--docs&viewMode=docs&globals=#editable

@KamilEmeleev
KamilEmeleev merged commit ffa04b3 into main Jul 17, 2026
8 checks passed
@KamilEmeleev
KamilEmeleev deleted the feat/ds-4765 branch July 17, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants