mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 06:52:43 +01:00
fix for search clearing text/not scrolling
This commit is contained in:
@@ -1,21 +1,24 @@
|
||||
import GradientBackground from '@app/components/GradientBackground'
|
||||
import colors from '@app/styles/colors'
|
||||
import dimensions from '@app/styles/dimensions'
|
||||
import React from 'react'
|
||||
import { ScrollViewProps, useWindowDimensions } from 'react-native'
|
||||
import React, { ForwardedRef, PropsWithChildren } from 'react'
|
||||
import { ScrollView, ScrollViewProps, useWindowDimensions } from 'react-native'
|
||||
import Animated from 'react-native-reanimated'
|
||||
|
||||
const GradientScrollView: React.FC<
|
||||
export type GradientScrollViewProps = PropsWithChildren<
|
||||
Animated.AnimateProps<ScrollViewProps> & {
|
||||
offset?: number
|
||||
}
|
||||
> = props => {
|
||||
>
|
||||
|
||||
const GradientScrollView = React.forwardRef<ScrollView, GradientScrollViewProps>((props, ref) => {
|
||||
const layout = useWindowDimensions()
|
||||
|
||||
const minHeight = layout.height - (dimensions.top() + dimensions.bottom())
|
||||
|
||||
return (
|
||||
<Animated.ScrollView
|
||||
ref={ref as ForwardedRef<Animated.ScrollView>}
|
||||
overScrollMode="never"
|
||||
{...props}
|
||||
style={[props.style, { backgroundColor: colors.gradient.low }]}
|
||||
@@ -24,6 +27,6 @@ const GradientScrollView: React.FC<
|
||||
{props.children}
|
||||
</Animated.ScrollView>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
export default GradientScrollView
|
||||
|
||||
Reference in New Issue
Block a user