Disabled date entered manually is not reverted on blur
@Ye-YiChen がすでに取り組んでいます。
2026年10月10日 から。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
Start by tracing the blur path through flushFieldSubmit, triggerSubmitChange, and the popup-close handling described in the issue; compare it with the Enter path and the previous useRangeValue reset behavior. Add or update a regression test for a controlled picker with a rejected disabledDate, then verify blur restores the selected value while Enter continues to do so.
索引モデルが issue の本文から書いたものです。
説明
Description
Since @rc-component/picker 1.12.0, manually entering a date rejected by disabledDate and then blurring the input leaves the rejected date displayed.
In 1.11.0, the input reverted to the previously selected value after blur.
Enter and blur now behave differently: pressing Enter restores the previous value, while blurring leaves the disabled date in the input.
Reproduction
Use a controlled single date picker with:
- Moment generateConfig
- Format: MM/DD/YYYY
- Value: 06/15/2026
- disabledDate rejecting dates before 06/01/2026
- State updated only through onChange
- Focus the input.
- Replace its contents with 03/15/2026.
- Click outside the picker.
Expected behavior
The disabled date is rejected, and the input displays the previously selected value, 06/15/2026, consistent with version 1.11.0.
Actual behavior
The input continues to display 03/15/2026, although onChange does not accept that date and the controlled value remains 06/15/2026.
Repeating the same steps but pressing Enter instead of clicking outside restores 06/15/2026.
Minimal example
import React, { useState } from 'react';
import Picker from '@rc-component/picker';
import momentConfig from '@rc-component/picker/lib/generate/moment';
import enUS from '@rc-component/picker/lib/locale/en_US';
import moment from 'moment';
const format = 'MM/DD/YYYY';
const minDate = moment('06/01/2026', format);
export default function Example() {
const [value, setValue] = useState(moment('06/15/2026', format));
return (
<Picker
generateConfig={momentConfig}
locale={enUS}
format={format}
value={value}
disabledDate={(date) => date.isBefore(minDate, 'day')}
onChange={setValue}
/>
);
}
Versions verified
- 1.11.0: previous value is restored on blur.
- 1.12.0: disabled date remains displayed on blur.
- 1.15.0: same behavior as 1.12.0.
Possible cause
This appears related to PR #994, which introduced useRangeValueChange.
Previously, useRangeValue reset the temporary calendar value to mergedValue after the interaction ended.
In the new flow, flushFieldSubmit calls triggerSubmitChange and closes the popup without handling its false return value. When disabledDate rejects the submission, the temporary calendar value is not reset on blur.
After Enter, the interaction is already completed when popupClose is processed, which takes the reset path and restores the previous value.
- 主要言語
- TypeScript
- スター
- 304
- フォーク
- 347
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
react-component/picker のほかの issue
-
enter date manually in format YY prevent the user to add YYYY対応中かも @nrps9909 が 45 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
react-component/picker#956 · コメント 1 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
react-component/picker#955 · コメント 1 件 · リアクション 1 件 ·
-
[Bug / DX]: Deep imports for generateConfig are incompatible with pnpm and break module resolution対応中かも @DanielChutkowskiJMMJ が 327 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 58/100
react-component/picker#949 ·
-
DatePicker does not trigger onChange when manually clearing input text対応中かも @nrps9909 が 45 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
react-component/picker#946 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
react-component/picker#939 ·
react-component/picker の issue をすべて見る
似ている issue
-
area/frontend area/v2 kind/bug priority/needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
kubeflow/notebooks#1498 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
P1
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
SuruchBoss/Cwork#90 ·
-
bug cli service
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
521xueweihan/HelloGitHub#3922 ·