mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.31k stars 32.12k forks source link

[Input][Joy]: Safari shows today's date if value is null #37226

Open olivierkastel opened 1 year ago

olivierkastel commented 1 year ago

Duplicates

Latest version

Steps to reproduce 🕹

Link to live example:

Steps:

  1. Use Chrome and go to the official documentation. Look how the input shows mm/dd/yyyy
  2. Use safari and go to the same page. The input shows 05/10/2023

Current behavior 😯

Misbehavior between Chrome and Safari.

Expected behavior 🤔

Safari should show mm/dd/yyyy. Right now the user can be confused that a date has already been input.

Context 🔦

I did a simple form with a birthday field. A user told me that all users had the same birthday, and was today... I realized later on that it only happens on Safari.

Your environment 🌎

npx @mui/envinfo ``` System: OS: macOS 13.3 Binaries: Node: 18.10.0 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 8.19.2 - /usr/local/bin/npm Browsers: Chrome: 112.0.5615.137 Edge: Not Found Firefox: 90.0.2 Safari: 16.4 npmPackages: @emotion/react: ^11.10.0 => 11.10.6 @emotion/styled: ^11.10.0 => 11.10.6 @mui/base: 5.0.0-alpha.119 @mui/core-downloads-tracker: 5.13.0 @mui/icons-material: ^5.10.2 => 5.11.11 @mui/joy: ^5.0.0-alpha.79 => 5.0.0-alpha.79 @mui/lab: ^5.0.0-alpha.96 => 5.0.0-alpha.121 @mui/material: ^5.13.0 => 5.13.0 @mui/private-theming: 5.12.3 @mui/styled-engine: 5.12.3 @mui/system: 5.12.3 @mui/types: 7.2.4 @mui/utils: 5.12.3 @mui/x-data-grid: 5.17.25 @mui/x-data-grid-pro: ^5.17.23 => 5.17.25 @mui/x-date-pickers: ^6.0.0 => 6.0.3 @mui/x-date-pickers-pro: ^6.0.0 => 6.0.3 @mui/x-license-pro: 5.17.12 @types/react: 18.2.0 react: ^18.2.0 => 18.2.0 react-dom: ^18.2.0 => 18.2.0 styled-components: ^5.3.5 => 5.3.6 typescript: 4.9.5 ```
gitstart commented 1 year ago

@gzrae @siriwatknp I would like to pick this up

siriwatknp commented 1 year ago

@gzrae @siriwatknp I would like to pick this up

Sure! can you propose the solution here first? To be honest, I am not sure if we can fix this. See native html input type date.

gitstart commented 1 year ago

@siriwatknp here's my proposed solution

image (2)

siriwatknp commented 1 year ago

@siriwatknp here's my proposed solution

image (2)

Thanks! I think we should first provide your solution in the docs because I don't think overriding the native behavior is what everyone wants.

gitstart commented 1 year ago

@siriwatknp here's my proposed solution image (2)

Thanks! I think we should first provide your solution in the docs because I don't think overriding the native behavior is what everyone wants.

Alright @siriwatknp, how do we go about that?

rayfarer commented 1 year ago

Any idea if this has been addressed?

piskor-kuba commented 1 year ago

Hi, is there any solution for this issue?