Skip to content

Ensure Date(Time)Picker does not clear on partial entry - #720

Open
philippjfr wants to merge 1 commit into
mainfrom
date_picker_clear_fix
Open

Ensure Date(Time)Picker does not clear on partial entry#720
philippjfr wants to merge 1 commit into
mainfrom
date_picker_clear_fix

Conversation

@philippjfr

Copy link
Copy Markdown
Contributor

The DatePicker/DatetimePicker updateModelValue and handleChange treated "field is fully empty" (null) and "field is mid-edit with an incomplete section" (a non-null but structurally invalid dayjs object) identically. MUI fires onAccept on every keystroke for field-only edits (not just on blur/Enter), so typing a single digit into the year section immediately produced an invalid intermediate dayjs value, which the old code treated as "clear" whenever clearable=True — wiping the field and committing None to Python.

This ensures an invalid partial date entry no longer triggers a clear and commit of None.

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.67%. Comparing base (0a6ef7a) to head (09b83b6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #720      +/-   ##
==========================================
- Coverage   84.23%   83.67%   -0.56%     
==========================================
  Files          34       34              
  Lines        3958     3958              
==========================================
- Hits         3334     3312      -22     
- Misses        624      646      +22     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant