Skip to content
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

[pickers] Rely on native behavior for disabled/readOnly behavior #26055

Merged
merged 2 commits into from
May 3, 2021

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Apr 29, 2021

The button for opening the picker is now :disabled when the picker has readOnly={true}. Clicking didn't have any effect so we might as well indicate that. This produces visual differences reported by argos. They are expected but I'll let reviewers approve them.

I've also moved checking against readOnly and disabled to their respective callsites. This simplifies usePickerState. If this causes breakage too often we can revert. But right now we only need openPicker in two places.

Manual testing:
https://deploy-preview-26055--material-ui.netlify.app/components/date-picker/#form-props
https://deploy-preview-26055--material-ui.netlify.app/components/date-range-picker/#form-props

@eps1lon eps1lon added accessibility a11y component: pickers This is the name of the generic UI component, not the React module! labels Apr 29, 2021
@mui-pr-bot
Copy link

mui-pr-bot commented Apr 29, 2021

Details of bundle changes

Generated by 🚫 dangerJS against 49e88d4

@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Apr 29, 2021
@eps1lon eps1lon marked this pull request as ready for review April 30, 2021 08:52
@eps1lon eps1lon merged commit d881694 into mui:next May 3, 2021
@eps1lon eps1lon deleted the feat/pickers/disabled branch May 3, 2021 05:55
eps1lon added a commit to eps1lon/material-ui that referenced this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility a11y component: pickers This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants