Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

TimePicker panel will keep scrolling after select a time.

オープン
#810 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
react, typescript
領域
frontend

調査の方向性

useScrollTo.ts から始めて、issue に記載されているスクロール距離の終了条件を調査します。Chrome 89 などの古いブラウザーで TimePicker の動作を再現し、時間を選択したときに距離が変化しなくなるとスクロールが停止すること、またその後にマウスホイールによるスクロールが通常どおり発生することを確認します。

索引モデルが issue の本文から書いたものです。

説明

i found the code below in useScrollTo.ts seemed to be buggy. After selecting a time from the time panel, the panel ul will scroll to the target li position. But when the target li is reaching top, the scrolling is not stopped, causing the scroll event could not be triggered on mouse-wheel scrolling.

// Break if dist get larger, which means user is scrolling
if (scrollDistRef.current !== null && scrollDistRef.current < dist) {
  stopScroll();
  return;
}
scrollDistRef.current = dist;

When the scenario above happens, the scrollDistRef.current is always equal to dist. So the stopScroll will be never called.
As I observed, the issue only happened on older browser like Chrome 89 in my case and did not occur on latest Chrome. In the latest Chrome, the scroll event can be fired even if the scrolling is not stopped.
I tried to changed the termimal condition as below, the scrolling is stopped and can be scrolled manually again:

if (scrollDistRef.current !== null && (scrollDistRef.current < dist || Math.abs(scrollDistRef.current - dist) < Number.EPSILON)) {
  stopScroll();
  return;
}

That is, to stop scrolling when scrollDistRef and dist is equal (dist does not change anymore).
Not sure if anyone got the same issue.
The antd version is 5.15.1

主要言語
TypeScript
スター
304
フォーク
347
平均マージ
1日 4時間
マージ済み PR(30日)
3

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

react-component/picker のほかの issue

react-component/picker の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。