Is your feature request related to a problem? Please describe.
There's no way to disable smooth scrolling when calling goToPage() from usePaginationContext. The scroll behavior is hardcoded to "smooth" in multiple places (smoothScrollTo.js, PaginationContext, ElementPageContext, useSearch). In our use case, we navigate to specific pages programmatically when users click references in a sidebar — the smooth animation feels laggy and disorienting when jumping 20+ pages.
Describe the solution you'd like
Add an optional behavior parameter to goToPage:
goToPage(page: number, options?: { behavior?: 'smooth' | 'instant' })
Or a global scroll behavior config on RPProvider:
<RPProvider src={url} scrollBehavior="instant">
Describe alternatives you've considered
- CSS
scroll-behavior: auto — doesn't work because scrollTo() is called with explicit behavior: "smooth", which overrides the CSS property.
scrollToElement from useElementPageContext supports { behavior: 'instant' }, but it requires an element index and isn't a drop-in replacement for goToPage.
- We currently use a custom webpack loader that replaces all
"smooth" strings in the library with "instant" at build time — it works but it's a brittle workaround.
Additional context
The hardcoded "smooth" behavior exists in:
dist/utils/smoothScrollTo.js
dist/contexts/ElementPageContext.js (default param)
dist/utils/hooks/useSearch.js
dist/PaginationContext-*.js (minified default parameter and comparison)
Is your feature request related to a problem? Please describe.
There's no way to disable smooth scrolling when calling
goToPage()fromusePaginationContext. The scroll behavior is hardcoded to"smooth"in multiple places (smoothScrollTo.js,PaginationContext,ElementPageContext,useSearch). In our use case, we navigate to specific pages programmatically when users click references in a sidebar — the smooth animation feels laggy and disorienting when jumping 20+ pages.Describe the solution you'd like
Add an optional
behaviorparameter togoToPage:Or a global scroll behavior config on
RPProvider:Describe alternatives you've considered
scroll-behavior: auto— doesn't work becausescrollTo()is called with explicitbehavior: "smooth", which overrides the CSS property.scrollToElementfromuseElementPageContextsupports{ behavior: 'instant' }, but it requires an element index and isn't a drop-in replacement forgoToPage."smooth"strings in the library with"instant"at build time — it works but it's a brittle workaround.Additional context
The hardcoded
"smooth"behavior exists in:dist/utils/smoothScrollTo.jsdist/contexts/ElementPageContext.js(default param)dist/utils/hooks/useSearch.jsdist/PaginationContext-*.js(minified default parameter and comparison)