mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.16k stars 1.3k forks source link

[pickers] MonthPicker and YearPicker don't support `disableHighlightToday` #5552

Closed Vdoshi25 closed 2 years ago

Vdoshi25 commented 2 years ago

Duplicates

Latest version

Current behavior 😯

Opening the datePicker in year view opens with highlighted year [currently 2022] Clicking on 'ok' does not display the highlighted year in the field.

Either should be able to remove the highlight of the current Year or does not have to click on the year before clicking 'ok'

Expected behavior 🤔

If the date, month, year is already highlighted it means it is also selected to appear in the form field by clicking ok

Steps to reproduce 🕹

Link to live example:https://codesandbox.io/s/staticdatepickerdemo-demo-mui-x-forked-453kme?file=/demo.tsx

Steps: 1.comment out the disableHighlightToday 2.It affects the date but does not do anything in month or year

Context 🔦

Due to this highlighted year, user thinks the year is already selected and click ok on the open dialog. But year is actually not selected and which makes no change on the form field

Your environment 🌎

npx @mui/envinfo ``` System: OS: macOS 11.3.1 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 42.31 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 14.17.6 - ~/.nvm/versions/node/v14.17.6/bin/node Yarn: 1.22.10 - ~/tongal/web/web2/node_modules/.bin/yarn npm: 7.23.0 - ~/.nvm/versions/node/v14.17.6/bin/npm Managers: Gradle: 7.4.2 - ~/.sdkman/candidates/gradle/current/bin/gradle Homebrew: 3.3.9 - /usr/local/bin/brew Maven: 3.8.4 - ~/.sdkman/candidates/maven/current/bin/mvn pip3: 19.2.3 - /usr/bin/pip3 RubyGems: 3.0.3 - /usr/bin/gem Utilities: Make: 3.81 - /usr/bin/make GCC: 4.2.1 - /usr/bin/gcc Git: 2.30.1 - /usr/bin/git Clang: 12.0.5 - /usr/bin/clang Servers: Apache: 2.4.46 - /usr/sbin/apachectl Virtualization: Docker: 20.10.8 - /usr/local/bin/docker IDEs: IntelliJ: 2021.2.3 Nano: 2.0.6 - /usr/bin/nano Vim: 8.2 - /usr/bin/vim Xcode: /undefined - /usr/bin/xcodebuild Languages: Bash: 3.2.57 - /bin/bash Java: 17.0.1 - /usr/bin/javac Perl: 5.30.2 - /usr/bin/perl PHP: 7.3.24 - /usr/bin/php Python: 2.7.16 - /usr/bin/python Python3: 3.8.2 - /usr/bin/python3 Ruby: 2.6.3 - /usr/bin/ruby Databases: SQLite: 3.32.3 - /usr/bin/sqlite3 Browsers: Chrome: 103.0.5060.134 Safari: 14.1 ```

Order ID 💳 (optional)

No response

DanailH commented 2 years ago

Hi, @Vdoshi25 thanks for raising this! I'm tagging @flaviendelangle or @alexfauquette to take a look when they have some time.

flaviendelangle commented 2 years ago

Indeed, those two views should support disableHighlightToday