Skip to content

fix(plugin-scroll): horizontal layout extent, centering and programmatic scroll#541

Merged
bobsingor merged 4 commits into
embedpdf:mainfrom
luissardon:fix/plugin-scroll-horizontal-smooth-scroll
Mar 25, 2026
Merged

fix(plugin-scroll): horizontal layout extent, centering and programmatic scroll#541
bobsingor merged 4 commits into
embedpdf:mainfrom
luissardon:fix/plugin-scroll-horizontal-smooth-scroll

Conversation

@luissardon
Copy link
Copy Markdown
Contributor

fix #538

BREAKING CHANGE: none

  • Use scroll-axis extent (width vs height) for visible range and end spacing so horizontal mode no longer treats item height as the scroll extent.
  • Disable horizontal centering (getCenteringOffsetX → 0) so pages stay in a plain row; vertical keeps centering via total content width.
  • During pageChangeState.isChanging, keep store currentPage from viewport-derived metrics and avoid duplicate pageChange$ until user-driven scroll resumes; startPageChange sets currentPage + emits pageChange$ optimistically.
  • In commitMetrics, dispatch before scroll$.emit so listeners that read state see metricsToCommit (single source of truth).
  • Set PageLayout.elevated: false when building virtual items (required field; selectors still override from interaction manager).

…tic scroll

BREAKING CHANGE: none

- Use scroll-axis extent (width vs height) for visible range and end spacing
  so horizontal mode no longer treats item height as the scroll extent.
- Disable horizontal centering (getCenteringOffsetX → 0) so pages stay in a
  plain row; vertical keeps centering via total content width.
- During pageChangeState.isChanging, keep store currentPage from viewport-
  derived metrics and avoid duplicate pageChange$ until user-driven scroll
  resumes; startPageChange sets currentPage + emits pageChange$ optimistically.
- In commitMetrics, dispatch before scroll$.emit so listeners that read state
  see metricsToCommit (single source of truth).
- Set PageLayout.elevated: false when building virtual items (required field;
  selectors still override from interaction manager).
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 19, 2026

@luissardon is attempting to deploy a commit to the OpenBook Team on Vercel.

A member of the Team first needs to authorize it.

@bobsingor bobsingor merged commit 352cc5f into embedpdf:main Mar 25, 2026
0 of 5 checks passed
@github-actions github-actions Bot mentioned this pull request Mar 25, 2026
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.

Bug report: Horizontal scroll and page navigation issues in @embedpdf/plugin-scroll

2 participants