Closed hirasso closed 1 year ago
Closes #34
Description
Adds a new rule option scroll, to overwrite the default behavior of disabling scroll.reset for fragment visits:
scroll
scroll.reset
{ scroll?: boolean | string; }
Example1
Scroll to the top for a selected fragment visit:
const rules: FragmentRule[] = [ { from: "/items/:filter?", to: "/items/:filter?", containers: ["#list"], scroll: true } ];
Example 2
Scroll to the element #list for a selected fragment visit:
#list
const rules: FragmentRule[] = [ { from: "/items/:filter?", to: "/items/:filter?", containers: ["#list"], scroll: '#list' } ];
Checks
master
npm run lint
Sweet!
Closes #34
Description
Adds a new rule option
scroll
, to overwrite the default behavior of disablingscroll.reset
for fragment visits:Example1
Scroll to the top for a selected fragment visit:
Example 2
Scroll to the element
#list
for a selected fragment visit:Checks
master
branchnpm run lint
)