fix: add overflow-y-hidden for mac users

This commit is contained in:
qtchaos 2024-03-22 17:42:18 +02:00
parent bde2231a90
commit 39bcf8c270
No known key found for this signature in database
GPG Key ID: 7DA98B2B9EF06A90

View File

@ -41,8 +41,13 @@ export function Volume(props: Props) {
const handleMouseEnter = useCallback(async () => {
if (await canChangeVolume()) setHovering(true);
document.body.classList.add("overflow-y-hidden");
}, [setHovering]);
const handleMouseLeave = () => {
document.body.classList.remove("overflow-y-hidden");
};
let percentage = makePercentage(volume * 100);
if (dragging) percentage = makePercentage(dragPercentage);
const percentageString = makePercentageString(percentage);
@ -61,6 +66,7 @@ export function Volume(props: Props) {
<div
className={props.className}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
onWheel={handleWheel}
>
<div className="pointer-events-auto flex cursor-pointer items-center py-0 touch-none">