Skip to content

scrollEventThrottle has no effect on SectionList #18441

@hugofelp

Description

@hugofelp

scrollEventThrottle doesn't seem to make any difference when applied to SectionList. It works as expected with ScrollView.

Environment

Environment:
OS: macOS High Sierra 10.13.3
Node: 8.9.4
Yarn: 1.2.1
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: ^16.3.0-alpha.1 => 16.3.0-alpha.2
react-native: 0.54.2 => 0.54.2

Steps to Reproduce

export default class App extends Component<Props> {
  render() {
    return (
      <View style={styles.container}>
        <ScrollView
          scrollEventThrottle={ 1000 }
          onScroll={ e => console.log( Date.now() ) }
        >
          <Text>ScrollView Text</Text>
        </ScrollView>


        <SectionList
          renderItem={ ( { item } ) => <Text>SectionList Text</Text> }
          sections={ [ {
            title: 'section title',
            data: [ 'item' ]
          } ] }
          scrollEventThrottle={ 1000 }
          onScroll={ e => console.log( Date.now() ) }
        />
      </View>
    );
  }
}

Expected Behavior

The events logged to the console should have at least 1000ms between them.

Actual Behavior

SectionList logs events at high rates regardless of the value passed to scrollEventThrottle

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions