Maintain scroll positions when switching tabs
This commit is contained in:
parent
45c61e7596
commit
52acec9d21
4 changed files with 81 additions and 29 deletions
12
client/src/js/util/scrollPosition.js
Normal file
12
client/src/js/util/scrollPosition.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
const positions = {};
|
||||
|
||||
export function getScrollPos(key) {
|
||||
if (key in positions) {
|
||||
return positions[key];
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
export function saveScrollPos(key, pos) {
|
||||
positions[key] = pos;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue