Skip to content

Commit 6aa3cc4

Browse files
committed
fix: when autoPlay is false, manual sliding will still autoPlay
fix #111
1 parent ea23e9e commit 6aa3cc4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/hooks/useAutoPlay.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ export function useAutoPlay(opts: {
3535
}, []);
3636

3737
const start = React.useCallback(() => {
38+
if (!autoPlay) {
39+
return;
40+
}
3841
stopped.current = false;
3942
play();
40-
}, [play]);
43+
}, [play, autoPlay]);
4144

4245
React.useEffect(() => {
4346
if (autoPlay) {

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3607,7 +3607,7 @@ [email protected]:
36073607

36083608
cz-conventional-changelog@^3.3.0:
36093609
version "3.3.0"
3610-
resolved "https://registry.npm.taobao.org/cz-conventional-changelog/download/cz-conventional-changelog-3.3.0.tgz#9246947c90404149b3fe2cf7ee91acad3b7d22d2"
3610+
resolved "https://registry.nlark.com/cz-conventional-changelog/download/cz-conventional-changelog-3.3.0.tgz#9246947c90404149b3fe2cf7ee91acad3b7d22d2"
36113611
integrity sha1-kkaUfJBAQUmz/iz37pGsrTt9ItI=
36123612
dependencies:
36133613
chalk "^2.4.1"

0 commit comments

Comments
 (0)