react-native-web icon indicating copy to clipboard operation
react-native-web copied to clipboard

ScrollView: support for contentOffset prop

Open relign opened this issue 6 years ago • 5 comments

when I use ScrollView work in Carousel Component. I need the prop. I want to know why not support?

relign avatar Mar 05 '19 06:03 relign

image this prop...

relign avatar Mar 05 '19 06:03 relign

Any news regarding this?

antonigiske avatar Jun 08 '20 11:06 antonigiske

Any news regarding this?

@necolas

relign avatar Jun 11 '20 02:06 relign

Please

alexlevy0 avatar Dec 24 '20 10:12 alexlevy0

For the time being I've gotten around this by using useEffect() on the scrollview ref and setting scrollTo without any animation on screen load.

import React, { useEffect, useRef } from 'react'
import { Text, ScrollView } from 'react-native'

export default function ScrollViewTest(props) {
    const scrollView = useRef();

    useEffect(() => {
        scrollView.current.scrollTo({x: spacing, animated:false})
    }, [])

    return (
        <ScrollView ref={scrollView}>
            <Text>Testing...</Text>
        </Scrollview>
    )
}

jackdewhurst avatar Feb 15 '21 15:02 jackdewhurst