Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug that autoplay stops when a click or drag event occurs while autoplay is enabled. ( #117 ) #1151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

takky94
Copy link

@takky94 takky94 commented Apr 12, 2023

Related Issues

#117

Description

日本のかたのようなのでせっかくなので日本語でPR出させていただきます。

素敵なライブラリありがとうございます :)
重宝させていただいております。
関連Issueの通りですが、自分の環境でも上記Issueの問題が依然としてdocでも確認できました。(下記動画)
なお、こちらの症状ですがカルーセル範囲外をクリックすることでautoplayが再開することも確認済みです。

2023-04-12.21.33.13.mov

コード読む感じ、play関数の責務がPause状態からの復帰のようにも思えたので、別途関数を分けるような下記の修正のほうが好ましいのかもと思いつつ、これのためだけに関数1つ増やすのもどうなのかとも思ったので一旦この状態で出しておきます。

+ on( EVENT_MOVED, keepPlaying );
// ...
+ function keepPlaying(): void {
+ if (!sttoped) play()
+ }
English Since you seem to be from Japan, I'll put up a PR in Japanese.

Thank you very much for your wonderful library :)
It is very useful.
I have been using it for a while now, but I still have the same problem as the above issue in my environment (see video below).
I have also confirmed that autoplay resumes by clicking outside the carousel area.

I read the code, and it seems that the responsibility of the play function is to recover from the pause state, so I thought it might be preferable to modify the code below to separate a separate function, but I also wondered if it would be a good idea to add a function just for this purpose, so I'll leave it as it is for now.

test suites

# npm run jest

Test Suites: 102 passed, 102 total
Tests:       403 passed, 403 total
Snapshots:   0 total
Time:        32.782 s
Ran all test suites.
# lint

(base) % npm run eslint      

> @splidejs/splide@4.1.4 eslint
> eslint src

(base) %

余談ですが npm install時に forceオプション付けてしまいました
.node-versionファイルかpackage.jsonにengine指定があると嬉しいです(node version起因でなければすみません🙇‍♂️)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant