Skip to content

feat(Table): add getScrollElement virtualize option#236

Merged
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-7e6d0f7
Jul 1, 2026
Merged

feat(Table): add getScrollElement virtualize option#236
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-7e6d0f7

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Upstream

7e6d0f7feat(Table): add getScrollElement virtualize option (#6657)

Brings the external-scroll capability (from ScrollArea's a84de85) to Table, and refactors ScrollArea's handling into a theme variant.

Component — 1:1

b24ui's ScrollArea.vue/Table.vue matched upstream's pre-change structure, so all component + theme changes applied verbatim:

ScrollArea: move isExternalScroll above the tv call + new externalScroll variant; simplify item offset to always subtract virtualizerProps.scrollMargin (defaults 0); drop the inline overflow: visible root style (now theme/scroll-area.ts's externalScroll variant sets root: 'overflow-visible').

Table: new getScrollElement?: () => Element | null in virtualize (removed from Omit); isExternalScroll + externalScroll variant (added alongside b24ui's pre-existing virtualize variant); getScrollElement resolver + scrollMargin computed wired into useVirtualizer; virtualPaddingTop/Bottom account for scrollMargin. theme/table.ts gains the externalScroll variant.

Tests

Added the with virtualize external scroll element renderEach case to Table.spec.ts. 4 snapshots: Table +2 (new case × nuxt/vue, root carries overflow-visible); ScrollArea 2 updated (external case now uses the overflow-visible class instead of the old inline style="overflow: visible;" — the refactor demonstrating itself). Suite 5147 passed (+2).

Docs — adapted to b24ui

  • Table: ported the ### With external scroll element section (badge New) + note, and created TableExternalScrollExample.vue — a faithful b24ui port of upstream's payments-table example (external overflow-auto container + sticky title feeding scrollMargin via useElementSize, B24Table :virtualize="{ scrollMargin, getScrollElement }", :b24ui), using b24ui conventions: TableColumn from @bitrix24/b24ui-nuxt, resolveComponent('B24Badge'), air status colors (air-primary-success/air-primary-alert/air-primary, matching the existing TableVirtualizeExample).
  • ScrollArea: extended the (previously trimmed, feat(ScrollArea): add getScrollElement virtualize option #233) example with the horizontal-orientation option upstream added — orientation prop, axis-aware itemSize/scrollMargin, left-vs-top header, Start/Top button — plus the matching orientation options block in scroll-area.md. The find-toolbar dropped in feat(ScrollArea): add getScrollElement virtualize option #233 stays dropped.

useElementSize is imported explicitly from @vueuse/core (not auto-imported in b24ui docs).

Verify (CI=true)

dev:prepare · lint · typecheck (both docs examples compile) · test (225 files, 5147 passed / 6 skipped) · build — all green.

Ledger

🤖 Generated with Claude Code


Generated by Claude Code

Port of upstream nuxt/ui 7e6d0f7 (#6657).

Brings the external-scroll capability (from ScrollArea's a84de85) to Table, and
refactors ScrollArea's handling to a theme variant:

- Table: new `getScrollElement` in the `virtualize` option; `isExternalScroll` +
  an `externalScroll` theme variant; a `getScrollElement` resolver + `scrollMargin`
  computed wired into the virtualizer; `virtualPaddingTop`/`Bottom` account for
  `scrollMargin` so rows sit inline below preceding content.
- ScrollArea: move `isExternalScroll` above the theme call and feed a new
  `externalScroll` variant; simplify the item offset to always subtract
  `scrollMargin` (defaults 0); drop the inline `overflow: visible` root style in
  favour of the theme variant.

Adds a Table renderEach case (4 snapshots), a Table docs section + example, and a
horizontal-orientation option on the ScrollArea example. Docs adapted to b24ui
conventions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
@IgorShevchik IgorShevchik merged commit 85d5bd3 into main Jul 1, 2026
1 check passed
@IgorShevchik IgorShevchik deleted the sync/nuxt-7e6d0f7 branch July 1, 2026 09:48
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.

2 participants