react-native-quick-scroll
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -8,14 +8,6 @@ import React from 'react'; | ||
class QuickScrollList extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.position = new Animated.Value(0); | ||
this.scrollBar = new Animated.Value(ScreenWidth); | ||
this.flatlistRef = React.createRef(); | ||
this.disableOnScrollEvent = false; | ||
} | ||
static defaultProps = { | ||
flashDuration: 40, | ||
flashOutDuration: 2000, | ||
rightOffset: 12, | ||
rightOffset: 10, | ||
thumbHeight: 60, | ||
@@ -29,3 +21,8 @@ hiddenPosition: ScreenWidth + 10, | ||
createRef = ref => { | ||
position = new Animated.Value(0); | ||
scrollBar = new Animated.Value(ScreenWidth); | ||
flatlistRef = React.createRef(); | ||
disableOnScrollEvent = false; | ||
createRef = (ref) => { | ||
this.flatlistRef = ref; | ||
@@ -35,3 +32,3 @@ this.props.ref && this.props.ref(ref); | ||
onThumbDrag = event => { | ||
onThumbDrag = (event) => { | ||
const { data, itemHeight, thumbHeight, viewportHeight } = this.props; | ||
@@ -57,3 +54,3 @@ const availableHeight = viewportHeight - thumbHeight; | ||
moveThumbOnScroll = e => { | ||
moveThumbOnScroll = (e) => { | ||
if (this.disableOnScrollEvent) { | ||
@@ -86,3 +83,3 @@ this.disableOnScrollEvent = false; | ||
onScrollEnd = (event, gesture) => { | ||
onScrollGlideEnd = (event, gesture) => { | ||
const { flashDuration, flashOutDuration } = this.props; | ||
@@ -95,3 +92,3 @@ const flashOut = Animated.timing(this.scrollBar, { | ||
setTimeout(() => flashOut.start(), flashOutDuration); | ||
this.props.onScrollEndDrag && this.props.onScrollEndDrag(event, gesture); | ||
this.props.onMomentumScrollEnd && this.props.onMomentumScrollEnd(event, gesture); | ||
}; | ||
@@ -102,3 +99,3 @@ | ||
let propObj = {}; | ||
prop.forEach(val => { | ||
prop.forEach((val) => { | ||
propObj = { ...propObj, ...val }; | ||
@@ -123,2 +120,3 @@ }); | ||
onScrollEndDrag={this.onScrollEnd} | ||
onMomentumScrollEnd={this.onScrollGlideEnd} | ||
showsVerticalScrollIndicator={false} | ||
@@ -171,2 +169,2 @@ onScrollToIndexFailed={() => {}} | ||
} | ||
}; | ||
}; |
MIT License | ||
Copyright (c) 2019 Faisal Arshed | ||
Copyright (c) Faisal Arshed | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
@@ -5,0 +5,0 @@ of this software and associated documentation files (the "Software"), to deal |
{ | ||
"name": "react-native-quick-scroll", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "author": "Faisal Arshed", |
@@ -57,3 +57,3 @@ # react-native-quick-scroll [![npm version](https://img.shields.io/npm/v/react-native-quick-scroll.svg?style=flat)](https://www.npmjs.com/package/react-native-quick-scroll) | ||
| `flashOutDuration` | `number` | `2000` | The time after which scroll bar disappears (in ms) | No | | ||
| `rightOffset` | `number` | `12` | The distance of the scroll bar from the right edge of screen | No | | ||
| `rightOffset` | `number` | `10` | The distance of the scroll bar from the right edge of screen | No | | ||
| `thumbStyle` | `object` | | Style object for the scroll bar thumb (Don't pass `height` here, use the `thumbHeight` prop instead) | No | | ||
@@ -60,0 +60,0 @@ | `scrollbarStyle` | `object` | | Style object for the scroll bar | No | |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
149