File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 5
5
" react-native" ,
6
6
" ios"
7
7
],
8
- "version" : " 1.5.4 " ,
8
+ "version" : " 1.5.6 " ,
9
9
"description" : " Swiper component for React Native." ,
10
10
"main" : " index.js" ,
11
11
"scripts" : {
Original file line number Diff line number Diff line change @@ -167,6 +167,9 @@ export default class extends Component {
167
167
const sizeChanged = ( nextProps . width || width ) !== this . state . width ||
168
168
( nextProps . height || height ) !== this . state . height
169
169
if ( ! nextProps . autoplay && this . autoplayTimer ) clearTimeout ( this . autoplayTimer )
170
+
171
+ if ( nextProps . autoplay ) this . autoplay ( true ) ;
172
+
170
173
this . setState ( this . initState ( nextProps , sizeChanged ) )
171
174
}
172
175
@@ -245,11 +248,11 @@ export default class extends Component {
245
248
/**
246
249
* Automatic rolling
247
250
*/
248
- autoplay = ( ) => {
249
- if ( ! Array . isArray ( this . props . children ) ||
251
+ autoplay = ( forceAutoPlay = false ) => {
252
+ if ( ! forceAutoPlay && ( ! Array . isArray ( this . props . children ) ||
250
253
! this . props . autoplay ||
251
254
this . internals . isScrolling ||
252
- this . state . autoplayEnd ) return
255
+ this . state . autoplayEnd ) ) return
253
256
254
257
this . autoplayTimer && clearTimeout ( this . autoplayTimer )
255
258
this . autoplayTimer = setTimeout ( ( ) => {
You can’t perform that action at this time.
0 commit comments