mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[pickers] Fire `onError` for partially filled date

Open flaviendelangle opened this issue 8 months ago • 4 comments

Proposal to solve #17499

Question: should we show the field in error state for partially filled date (like in v7)? If so, then this PR is fine. Otherwise, we might want a different approach (maybe the behavior should be configurable through a prop).

flaviendelangle avatar Apr 23 '25 08:04 flaviendelangle

Deploy preview: https://deploy-preview-17514--material-ui-x.netlify.app/

Bundle size report

Bundle size will be reported once CircleCI build #558866 finishes.

Generated by :no_entry_sign: dangerJS against 2a85ae90451030369f4071482c6eb34fbe851885

mui-bot avatar Apr 23 '25 08:04 mui-bot

We are missing the changes on Picker level, Pro package and some tests for this.

The pro validation (date range, date time range and time range) always use date validation and time validation. I need to check the behavior on the picker, but the validation value from the field should be correctly forwarded. And we need test of course :ok_hand:

flaviendelangle avatar Apr 23 '25 13:04 flaviendelangle

I need to check the behavior on the picker, but the validation value from the field should be correctly forwarded.

I've tested and it seemed that Picker did not trigger this error, same for the range Pickers and Fields. 🤔

LukasTy avatar Apr 23 '25 13:04 LukasTy

I'll have a look

flaviendelangle avatar Apr 23 '25 13:04 flaviendelangle

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Jun 24 '25 07:06 github-actions[bot]

Yes, please provide convenient way to detect that input is invalid (incomplete, partial). As of now, just having null instead of Invalid Date is a dangerous regression. Users can easily miss part of a placeholder still being visible and progress through form assuming that value was provided (validations will not block progress if field was not mandatory).

We will need a way to determine if current value is null (missing) or invalid, including a scenario when it was invalid and then the value was cleared. Maybe the most recent error status should also be passed as additional argument to change handler?

morzel85 avatar Jul 18 '25 14:07 morzel85