Client: Shared: Scrollbar: Disable mousemove on touch devices

This commit is contained in:
Aleksandr Lushkin 2024-05-16 12:00:05 +02:00
parent 6cc580c6c6
commit 8472e3749d

View File

@ -28,7 +28,7 @@ import React, { useEffect, useMemo, useRef, useState } from "react";
import { useTheme } from "styled-components";
import throttle from "lodash/throttle";
import { classNames } from "../../utils";
import { classNames, isTouchDevice } from "../../utils";
import StyledScrollbar from "./Scrollbar.styled";
import { ScrollbarProps } from "./Scrollbar.types";
@ -105,7 +105,8 @@ const ScrollbarComponent = React.forwardRef<Scrollbar, ScrollbarProps>(
}
: {};
const autoHideContentProps = autoHide ? { onMouseMove: showTracks } : {};
const autoHideContentProps =
autoHide && !isTouchDevice ? { onMouseMove: showTracks } : {};
return (
<StyledScrollbar