-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DatePicker] StaticDatePicker doesn't honor disabled #4594
Comments
I just realized what should have been obvious: mui/material-ui-pickers#1336 ("shouldDisableDate crushes DatePicker") has been fixed, so I can get basically the behavior I want by simply always returning true in |
I can reproduce this issue very well. I would love to contribute over this. |
I can still reproduce similar issue with Found out upgrading |
Sounds like this issue is solved. I moved the codesandbox to the new version and all the days appear light gray as expected https://codesandbox.io/s/material-ui-issue-forked-0v1z9d?file=/src/demo.js @scottlamb @michchan I am missing the bug? |
Oh, great, that looks as I'd expect. I just replaced my codesandbox link at the top with one that renders with versions from when I filed the bug. (Looks like it'd rotted because I hadn't pinned versions, and somehow there was a case mismatch with |
Current Behavior 😯
StaticDatePicker doesn't appear to honor the
disabled={true}
attribute. It looks and behaves no differently (as far as I can tell) from whendisabled
is false or unspecified.(As an aside, many of the attributes on https://next.material-ui.com/api/static-date-picker/ seem like they're not actually relevant to this component? eg the description for
disableOpenPicker
makes more sense forDatePicker
thanStaticDatePicker
. I suspect a bunch of these are here by mistake, but I thinkdisabled
can and should do something.)Expected Behavior 🤔
All the days should be grayed out; clicking on them should have no effect.
Steps to Reproduce 🕹
https://codesandbox.io/s/material-ui-issue-forked-nc8gdh?file=/Demo.js
Steps:
Context 🔦
(I initially filed this as mui/material-ui-pickers#2172 but moving this over from there after seeing the banner saying that older version is no longer maintained.)
My software's UI is oriented to selecting/viewing existing segments of video. It only makes sense to select dates in which there is video available. Sometimes there are no such dates, eg if there are currently no cameras selected to view or if recording is broken. I think a static date picker makes the most sense because which dates are available is information I don't want to hide behind a click. I also don't think it makes sense for the date picker to appear and disappear (and thus other UI elements jump) based on whether any selection is valid; I'd rather it just appear disabled.
In my existing (ancient jQuery UI-based) interface, the date picker looks like this when disabled:
That's roughly what I want to match in my React/material-ui-based UI rewrite.
Your Environment 🌎
Chrome Version 88.0.4324.150 (Official Build) (x86_64)
`npx @material-ui/envinfo`
The text was updated successfully, but these errors were encountered: