You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/@react-aria/calendar/src/useCalendarCell.ts
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,11 @@ export function useCalendarCell(props: AriaCalendarCellProps, state: CalendarSta
101
101
);
102
102
103
103
if(isInvalid){
104
-
isSelected=true;
104
+
// don't mark unavaliable + invalid dates in range calendars as selected, that case only comes up via allowsNoncontiguousRanges
105
+
// and thus those unavailable dates shouldn't be selected. For single select calendars, we mark unavailble + invalid days as selected for styling reasons
106
+
if(!('highlightedRange'instate)||!isUnavailable){
107
+
isSelected=true;
108
+
}
105
109
}
106
110
107
111
// For performance, reuse the same date object as before if the new date prop is the same.
@@ -333,43 +332,3 @@ See the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/
333
332
<Checkboxvalue="basketball">Basketball</Checkbox>
334
333
</CheckboxGroup>
335
334
```
336
-
337
-
## Testing
338
-
339
-
### Test utils <VersionBadgeversion="beta"style={{marginLeft: 4, verticalAlign: 'bottom'}} />
340
-
341
-
`@react-spectrum/test-utils` offers common checkbox group interaction utilities which you may find helpful when writing tests. See [here](./testing.html#react-spectrum-test-utils) for more information on how to setup these utilities
342
-
in your tests. Below is the full definition of the checkbox group tester and a sample of how you could use it in your test suite.
@@ -399,43 +398,3 @@ respectively for container sizing considerations. Modal sizes on mobile devices
399
398
)}
400
399
</DialogTrigger>
401
400
```
402
-
403
-
## Testing
404
-
405
-
### Test utils <VersionBadgeversion="beta"style={{marginLeft: 4, verticalAlign: 'bottom'}} />
406
-
407
-
`@react-spectrum/test-utils` offers common dialog interaction utilities which you may find helpful when writing tests. See [here](./testing.html#react-spectrum-test-utils) for more information on how to setup these utilities
408
-
in your tests. Below is the full definition of the dialog tester and a sample of how you could use it in your test suite.
@@ -307,43 +306,3 @@ See the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/
307
306
<Radiovalue="dragon">Dragon</Radio>
308
307
</RadioGroup>
309
308
```
310
-
311
-
## Testing
312
-
313
-
### Test utils <VersionBadgeversion="beta"style={{marginLeft: 4, verticalAlign: 'bottom'}} />
314
-
315
-
`@react-spectrum/test-utils` offers common radio group interaction utilities which you may find helpful when writing tests. See [here](./testing.html#react-spectrum-test-utils) for more information on how to setup these utilities
316
-
in your tests. Below is the full definition of the radio group tester and a sample of how you could use it in your test suite.
0 commit comments