Skip to content

[TimePicker] AdapterDayjs fails to validate input when using with TimePicker #6984

Description

@hangryernest

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

When using dayjs-adapter, with time picker, when a user changes an existing time to something invalid (ie 99:99) the input does not enter an error state. Tested with '@mui/lab/AdapterDateFns" and '@mui/lab/AdapterMoment' and the input goes into error state as expected.

here is the the sandbox:
https://codesandbox.io/s/basictimepicker-material-demo-forked-mk19f?file=/public/index.html

Left: AdapterDateFns / Right: AdapterDayjs
image

Expected behavior 🤔

adapter should handle invalid times

Steps to reproduce 🕹

Steps:
https://codesandbox.io/s/basictimepicker-material-demo-forked-mk19f?file=/public/index.html

  1. enter invalid values in the two time pickers and see the difference

Context 🔦

No response

Your environment 🌎

`npx @mui/envinfo`
  System:
    OS: Windows 10 10.0.22000
  Binaries:
    Node: 14.16.1 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.14.12 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.22000.120.0), Chromium (96.0.1054.29)
  npmPackages:
    @emotion/react: 11.5.0 => 11.5.0 
    @emotion/styled: 11.3.0 => 11.3.0 
    @mui/core:  5.0.0-alpha.54 
    @mui/icons-material: 5.1.0 => 5.1.0 
    @mui/lab: 5.0.0-alpha.54 => 5.0.0-alpha.54 
    @mui/material: 5.1.0 => 5.1.0 
    @mui/private-theming:  5.1.0 
    @mui/styled-engine:  5.1.0 
    @mui/styles: 5.1.0 => 5.1.0
    @mui/system:  5.1.0
    @mui/types:  7.1.0
    @mui/utils:  5.1.1
    @mui/x-data-grid-pro: 5.0.1 => 5.0.1
    @mui/x-license-pro:  5.0.1
    @types/react:  17.0.1
    react: 17.0.2 => 17.0.2
    react-dom: 17.0.2 => 17.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: pickersChanges related to the date/time pickers.type: bugIt doesn't behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions