mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
fix(mobile): scroll optimization (#8362)
close AF-1421, AF-1418, AF-1423, AF-1358
This commit is contained in:
@@ -25,9 +25,13 @@ export const useThemeColorMeta = (color: string) => {
|
||||
const meta = getMeta();
|
||||
const old = meta.content;
|
||||
meta.content = color;
|
||||
// also modify document background (for over scroll bounce effect)
|
||||
const oldBg = document.documentElement.style.backgroundColor;
|
||||
document.documentElement.style.backgroundColor = color;
|
||||
|
||||
return () => {
|
||||
meta.content = old;
|
||||
document.documentElement.style.backgroundColor = oldBg;
|
||||
};
|
||||
}, [color]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user