When selecting values in panel with type different than the picker type dates are auto-selected.

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

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

評価

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

調査の方向性

triggerCalendarChange と useInnerValue hook から始め、特に issue で説明されている calendarValue の更新を確認してください。multiple Storybook story を使って年と दशकの選択を再現し、その後、参照されている PR とそのテストをコンテキストとして使用してください。別のパネルタイプを選択しても日付が自動選択されたり入力フィールドに値が入力されたりしなければ完了です。

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

説明

Currently when we have date picker with type = date and switch the panel mode selection through the popup to month and then year and then select an year from that picker to narrow down the date selection, triggerCalendarChange function is called, even though the picker mode is date, which causes the date associated with the year(01-01-year) to be auto-selected and shown in the input. There is also a comment on triggerCalendarChange, which says // Only trigger calendar event but not update internal calendarValue state, but triggerCalendarChange does update the calendarValue internally in useInnerValue hook line 147 - setCalendarValue(clone);,.

Using the multiple storybook where we have date picker and navigating to decade panel and selecting 2000-2009, causes value 2000-04-08 to be auto-selected as first multiples value
image
image

I've also open a PR with possible way of fixing the issue and test that can simulate it in master https://github.com/react-component/picker/pull/788

主要言語
TypeScript
スター
306
フォーク
356
平均マージ
1時間 42分
マージ済み PR(30日)
1

環境構築

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

はじめの一歩

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

react-component/picker のほかの issue

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

似ている issue

TypeScript の issue をもっと見る

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

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