diff options
Diffstat (limited to 'src/view/com/pager/DraggableScrollView.tsx')
-rw-r--r-- | src/view/com/pager/DraggableScrollView.tsx | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/view/com/pager/DraggableScrollView.tsx b/src/view/com/pager/DraggableScrollView.tsx index fc06b72e8..c98e34054 100644 --- a/src/view/com/pager/DraggableScrollView.tsx +++ b/src/view/com/pager/DraggableScrollView.tsx @@ -1,16 +1,25 @@ -import React, {ComponentProps} from 'react' +import {type ComponentPropsWithRef} from 'react' import {ScrollView} from 'react-native' import {useDraggableScroll} from '#/lib/hooks/useDraggableScrollView' +import {atoms as a, web} from '#/alf' -export const DraggableScrollView = React.forwardRef< - ScrollView, - ComponentProps<typeof ScrollView> ->(function DraggableScrollView(props, ref) { +export function DraggableScrollView({ + ref, + style, + ...props +}: ComponentPropsWithRef<typeof ScrollView>) { const {refs} = useDraggableScroll<ScrollView>({ outerRef: ref, cursor: 'grab', // optional, default }) - return <ScrollView ref={refs} horizontal {...props} /> -}) + return ( + <ScrollView + ref={refs} + style={[style, web(a.user_select_none)]} + horizontal + {...props} + /> + ) +} |