Skip to content

feat(#3346): add horizontal scrolling to Scroll Panel#4000

Closed
bdfranck wants to merge 0 commit into
vanessa/3347-sticky-header-footerfrom
benji/horizontal-scroll-panel
Closed

feat(#3346): add horizontal scrolling to Scroll Panel#4000
bdfranck wants to merge 0 commit into
vanessa/3347-sticky-header-footerfrom
benji/horizontal-scroll-panel

Conversation

@bdfranck

@bdfranck bdfranck commented May 29, 2026

Copy link
Copy Markdown
Collaborator

This PR adds a direction property to the Scroll Panel to allow for horizontal scrolling. This PR was branched off of #3933 and will need to be updated as that work evolves.

scrolling

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a direction prop to the Scroll Panel web component (and Angular/React wrappers) to support horizontal scrolling, including updated scroll-edge detection and updated shadow/border styling for left/right edges.

Changes:

  • Added direction: "vertical" | "horizontal" to the Scroll Panel web component and wrapper components.
  • Updated scroll state calculation to support horizontal edge states (at-left / at-right) and apply appropriate shadows/borders.
  • Added/updated tests and demo routes to exercise the new horizontal scrolling behavior.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
libs/web-components/src/components/scroll-panel/ScrollPanelWrapper.test.svelte Passes direction through the Svelte test wrapper into <goa-scroll-panel>.
libs/web-components/src/components/scroll-panel/ScrollPanel.svelte Implements the direction prop, horizontal scroll state detection, and horizontal styling (layout + shadows).
libs/web-components/src/components/scroll-panel/ScrollPanel.spec.ts Adds a spec asserting direction is passed to the custom element.
libs/react-components/src/lib/scroll-panel/scroll-panel.tsx Adds direction to the React wrapper prop types and forwards it to the web component.
libs/react-components/src/lib/scroll-panel/scroll-panel.spec.tsx Adds a React wrapper test asserting the direction attribute is set.
libs/angular-components/src/lib/components/scroll-panel/scroll-panel.ts Adds direction input and binds it as an attribute on the web component.
libs/angular-components/src/lib/components/scroll-panel/scroll-panel.spec.ts Adds an Angular wrapper test asserting the direction attribute is set.
apps/prs/react/src/routes/features/feat3347.tsx Adds a React demo section showcasing horizontal scrolling in the scroll panel.
apps/prs/angular/src/routes/features/feat3347/feat3347.component.ts Adds demo data (columns/rows) for the Angular horizontal scrolling example.
apps/prs/angular/src/routes/features/feat3347/feat3347.component.html Adds an Angular demo section showcasing horizontal scrolling in the scroll panel.
apps/prs/angular/src/routes/features/feat3347/feat3347.component.css Adds CSS for the Angular horizontal scrolling demo grid.
Comments suppressed due to low confidence (1)

libs/web-components/src/components/scroll-panel/ScrollPanel.svelte:38

  • _scrollState can now be "at-left"/"at-right", but the relayed event payload is typed as ScrollPanelStateChangeRelayDetail whose state union (in libs/web-components/src/types/relay-types.ts) still only allows "no-scroll" | "at-top" | "middle" | "at-bottom". This makes relay<ScrollPanelStateChangeRelayDetail>(..., { state: _scrollState, ... }) a type mismatch and will fail TypeScript compilation (and consumers can’t type-narrow horizontal states). Update the shared relay detail type (and any dependent logic, if needed) to include the new horizontal states.
  type ScrollState = "no-scroll" | "at-top" | "middle" | "at-bottom" | "at-left" | "at-right";

  let _hostEl: HTMLElement | null = null;
  let _scrollEl: HTMLElement | null = null;
  let _scrollState: ScrollState = "no-scroll";

Comment on lines +121 to +125
function updateScrollState() {
if (!_scrollEl) return;
const { scrollTop, scrollHeight, clientHeight } = _scrollEl;
const isVertical = direction === "vertical";
const scrollValue = isVertical ? _scrollEl.scrollTop : _scrollEl.scrollLeft;
const scrollSize = isVertical ? _scrollEl.scrollHeight : _scrollEl.scrollWidth;

@twjeffery twjeffery left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@bdfranck Maybe I'm not pulling in the right branch, but I think this needs a rebase onto the current #3933 before we can review it visually. It looks like it branched off an earlier point of that branch, before Vanessa's updates on the scroll panel's shadow styles.

Image

@bdfranck bdfranck closed this Jun 8, 2026
@bdfranck bdfranck force-pushed the benji/horizontal-scroll-panel branch from 3ca34a9 to d42b4dd Compare June 8, 2026 22:32
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.

Add default horizontal scroll behaviour to the table component for overflow content

3 participants