-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[test] disabled
prop disable calendar days
#4645
Conversation
These are the results for the performance tests:
|
@@ -67,4 +67,22 @@ describe('<StaticDatePicker />', () => { | |||
expect(getYearButton(2030)).to.have.attribute('disabled'); | |||
expect(getYearButton(2031)).not.to.have.attribute('disabled'); | |||
}); | |||
|
|||
it('prop `disabled` – disables all days', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other tests, they do the same check for readOnly
, I did not look into those for now but maybe it also make sense here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other readOnly
tests only check that the views are not accessible from the pickers. i.e. if you click on the calendar, it does not open the calendar view
I observed that the behavior, of disable
/readOnly
is well supported only on the StaticDatePicker
. I opened a follow-up issue to fix the other static components #4650
I think static pickers are not used or rarely with disabled
and even less with readOnly
, so I put it in needs upvote
@@ -148,11 +148,11 @@ export function PickersCalendarHeader<TDate>(props: PickersCalendarHeaderProps<T | |||
const selectPreviousMonth = () => onMonthChange(utils.getPreviousMonth(month), 'right'); | |||
|
|||
const isNextMonthDisabled = useNextMonthDisabled(month, { | |||
disableFuture: disableFuture || disabled, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disableFuture
is disabling compare to the current day, not the selected one, so it does not make sense, especially for the range picker. I moved the responsibility to adapt minDate
/maxDate
when picker is disabled to the parent
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not very familiar with the readOnly
pattern
Should the hover background be disabled on readOnly
when hovering a day in the DayPicker
?
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
I never used I don't thin |
OK, I don't get the goal of this prop but if it is the same elsewhere |
@alexfauquette the tests are failing on Safari, we probably need to early return (see other similar tests)
|
Fix #4594 by testing the corrected bug
Fix #4400
Fix #4650
In
readOnly
modeIn
disabled
mode