pl-fe: useLongPress: double scroll threshold

Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
mkljczk
2025-03-02 20:00:55 +01:00
parent 70848bab95
commit 216e34c53c

View File

@ -44,7 +44,7 @@ type LongPressOptions = {
};
const useLongPress = (callback: (e: Event) => void, options: LongPressOptions = {}) => {
const { threshold = 400, onStart, onFinish, onCancel, allowScroll = false, scrollThreshold = 20 } = options;
const { threshold = 400, onStart, onFinish, onCancel, allowScroll = false, scrollThreshold = 40 } = options;
const isLongPressActive = React.useRef(false);
const isPressed = React.useRef(false);
const timerId = React.useRef<NodeJS.Timeout>();