react-smooth-sheet
Version:
A customizable bottom sheet component for React applications.
16 lines (15 loc) • 412 B
JavaScript
export function scrollBottomSheet(
touchStart,
touchMove,
vh,
bottomSheetElement
) {
var bottomSheet = bottomSheetElement.current.childNodes[1];
bottomSheet.style.transition = "0.01s";
if (touchStart < touchMove) {
// finger moving down
touchMove > vh * 0.39
? (bottomSheet.style.bottom = `-${touchMove - touchStart}px`)
: (bottomSheet.style.bottom = `0`);
}
}