Disabled date entered manually is not reverted on blur
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 304
- Fork
- 347
- Merge medio
- 1g 2h
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di react-component/picker
-
enter date manually in format YY prevent the user to add YYYYForse già presa @nrps9909 l’ha presa 41 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
react-component/picker#956 · 1 commento · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
react-component/picker#955 · 1 commento · 1 reazione ·
-
[Bug / DX]: Deep imports for generateConfig are incompatible with pnpm and break module resolutionForse già presa @DanielChutkowskiJMMJ l’ha presa 323 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 58/100
react-component/picker#949 ·
-
DatePicker does not trigger onChange when manually clearing input textForse già presa @nrps9909 l’ha presa 41 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
react-component/picker#946 ·
-
需要RangePicker组件中增加aria属性Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
react-component/picker#939 ·
Tutte le issue di react-component/picker
Issue simili
-
Bump Firebase JS SDK (12.19.0 → 13.0.0)Forse già presa @SelaseKay l’ha presa oggi. ApertaNeeds Attention type: enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
invertase/react-native-firebase#9364 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 4 giorni
-
[fullsend] E2E: rhdh-version-override — run-e2e.sh overrides RHDH_VERSION to non-existent 2.1Apertae2e-failure ready-to-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
redhat-developer/rhdh-plugin-export-overlays#4261 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] 官网文档的图片挂了Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
area:cli bug triage:in-progress
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno