[pickers] Fire onError for partially filled date - #17514
Conversation
|
Deploy preview: https://deploy-preview-17514--material-ui-x.netlify.app/ Bundle size reportBundle size will be reported once CircleCI build #558866 finishes. |
onError for partially filled date
LukasTy
left a comment
There was a problem hiding this comment.
Nice idea! 👍
I like the idea, I think it should be a good compromise between the capabilities and compromises we had on v7. 👌
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've tested and it seemed that Picker did not trigger this error, same for the range Pickers and Fields. 🤔 |
|
I'll have a look |
| [fieldValueManager, state.sections], | ||
| ); | ||
|
|
||
| React.useEffect(() => { |
There was a problem hiding this comment.
TODO: Add support for multi input range fields
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
|
Yes, please provide convenient way to detect that input is invalid (incomplete, partial). 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? |
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).