mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
fix: add overflow-y-hidden for mac users
This commit is contained in:
parent
bde2231a90
commit
39bcf8c270
1 changed files with 6 additions and 0 deletions
|
@ -41,8 +41,13 @@ export function Volume(props: Props) {
|
||||||
|
|
||||||
const handleMouseEnter = useCallback(async () => {
|
const handleMouseEnter = useCallback(async () => {
|
||||||
if (await canChangeVolume()) setHovering(true);
|
if (await canChangeVolume()) setHovering(true);
|
||||||
|
document.body.classList.add("overflow-y-hidden");
|
||||||
}, [setHovering]);
|
}, [setHovering]);
|
||||||
|
|
||||||
|
const handleMouseLeave = () => {
|
||||||
|
document.body.classList.remove("overflow-y-hidden");
|
||||||
|
};
|
||||||
|
|
||||||
let percentage = makePercentage(volume * 100);
|
let percentage = makePercentage(volume * 100);
|
||||||
if (dragging) percentage = makePercentage(dragPercentage);
|
if (dragging) percentage = makePercentage(dragPercentage);
|
||||||
const percentageString = makePercentageString(percentage);
|
const percentageString = makePercentageString(percentage);
|
||||||
|
@ -61,6 +66,7 @@ export function Volume(props: Props) {
|
||||||
<div
|
<div
|
||||||
className={props.className}
|
className={props.className}
|
||||||
onMouseEnter={handleMouseEnter}
|
onMouseEnter={handleMouseEnter}
|
||||||
|
onMouseLeave={handleMouseLeave}
|
||||||
onWheel={handleWheel}
|
onWheel={handleWheel}
|
||||||
>
|
>
|
||||||
<div className="pointer-events-auto flex cursor-pointer items-center py-0 touch-none">
|
<div className="pointer-events-auto flex cursor-pointer items-center py-0 touch-none">
|
||||||
|
|
Loading…
Reference in a new issue