Skip to content

fix(ui5-table): keep focused cell visible next to sticky columns#13850

Open
aborjinik wants to merge 1 commit into
mainfrom
table-scroll-element-into-view
Open

fix(ui5-table): keep focused cell visible next to sticky columns#13850
aborjinik wants to merge 1 commit into
mainfrom
table-scroll-element-into-view

Conversation

@aborjinik

@aborjinik aborjinik commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

When navigating in overflowMode="Scroll", a focused cell or row could end up hidden behind a sticky element, behind a sticky column (selection, actions, or navigated) when moving horizontally, or behind the sticky header row when moving vertically. The scroll-into-view logic didn't subtract sticky pins per axis, and it resolved the vertical scroll container incorrectly.

Per-axis scroll delta. _scrollElementIntoView was reworked to compute the vertical and horizontal deltas independently via a new computeAxisScrollDelta helper. For a given axis, it subtracts the sticky pins from the relevant container edge and returns the delta needed to reveal the element on that axis. Sticky columns are now subtracted horizontally just as sticky header rows are subtracted vertically.

Sticky columns are collected from the row's selection, actions, and navigated cells (_stickyCells), and horizontal scrolling only applies when the table itself is the scroll container (overflowMode="Scroll").

Correct vertical scroll container. With overflowMode="Scroll" and a constrained height but no scrolling wrapper, the table element itself scrolls vertically — but the old logic walked up from the host and never reached it, so a focused row could stay hidden under the sticky header when navigating up after scrolling down. findVerticalScrollContainer now takes a requireOverflow flag and, starting from the table element, returns the first ancestor that actually overflows vertically (scrollHeight > clientHeight). This distinguishes the table element (whose overflow-y is auto-promoted from overflow-x but only scrolls when height-constrained) from an outer wrapper that owns the scrolling.

Tests cover the horizontal sticky-column cases (LTR, RTL, and a cell wider than the viewport) and the vertical sticky-header case in both setups , where the table itself scrolls, and where an outer wrapper scrolls.

Fixes: #13068

@aborjinik
aborjinik temporarily deployed to netlify-preview July 21, 2026 11:49 — with GitHub Actions Inactive
@sap-ui5-webcomponents-release

Copy link
Copy Markdown

@aborjinik
aborjinik force-pushed the table-scroll-element-into-view branch from c6ceb31 to c7ecef2 Compare July 22, 2026 12:07
@aborjinik
aborjinik temporarily deployed to netlify-preview July 22, 2026 12:07 — with GitHub Actions Inactive
@aborjinik
aborjinik requested a review from simlin July 22, 2026 12:33
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.

[SF][Table]: [Focus indicator should not be cut off when with single selection]

1 participant