fix(mobile): scroll optimization (#8362)

close AF-1421, AF-1418, AF-1423, AF-1358
This commit is contained in:
CatsJuice
2024-09-24 03:51:09 +00:00
parent e02d450e4f
commit 9eae3de1ae
10 changed files with 69 additions and 43 deletions

View File

@@ -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]);
};

View File

@@ -161,7 +161,9 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
data-disabled={disabled || undefined}
data-size={size}
data-variant={variant}
data-no-hover={withoutHover || undefined}
data-no-hover={
withoutHover || BUILD_CONFIG.isMobileEdition || undefined
}
data-mobile={BUILD_CONFIG.isMobileEdition}
onClick={handleClick}
>