InMemoryScrollingOptions
Configuration options for the scrolling feature which can be used with withInMemoryScrolling
function.
interface InMemoryScrollingOptions {
anchorScrolling?: 'disabled' | 'enabled'
scrollPositionRestoration?: 'disabled' | 'enabled' | 'top'
}
Child interfaces
Properties
Property | Description |
---|---|
anchorScrolling?: 'disabled' | 'enabled'
|
When set to 'enabled', scrolls to the anchor element when the URL has a fragment. Anchor scrolling is disabled by default. Anchor scrolling does not happen on 'popstate'. Instead, we restore the position that we stored or scroll to the top. |
scrollPositionRestoration?: 'disabled' | 'enabled' | 'top'
|
Configures if the scroll position needs to be restored when navigating back.
You can implement custom scroll restoration behavior by adapting the enabled behavior as in the following example.
|