Skip to content

Commit 7df3bcb

Browse files
author
Michael Jordan
authored
fix RSP-1412 DatePicker should not have combobox on grouping (#246)
1 parent d705916 commit 7df3bcb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+446
-145
lines changed

packages/@react-aria/calendar/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
export * from './useCalendar';
1414
export * from './useRangeCalendar';
1515
export * from './useCalendarCell';
16+
export * from './useCalendarTableHeader';
1617
export * from './types';

packages/@react-aria/calendar/src/useCalendarBase.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function useCalendarBase(props: CalendarPropsBase & DOMProps, state: Cale
5050
// Announce when the selected value changes
5151
useUpdateEffect(() => {
5252
if (selectedDateDescription) {
53-
announce(selectedDateDescription);
53+
announce(selectedDateDescription, 'polite', 4000);
5454
}
5555
// handle an update to the caption that describes the currently selected range, to announce the new value
5656
}, [selectedDateDescription]);
@@ -146,6 +146,8 @@ export function useCalendarBase(props: CalendarPropsBase & DOMProps, state: Cale
146146
'aria-disabled': isDisabled || null,
147147
'aria-labelledby': labelProps['aria-labelledby'],
148148
'aria-describedby': selectedDateDescription ? captionId : null,
149+
'aria-colcount': 7,
150+
'aria-rowcount': state.weeksInMonth + 1,
149151
onKeyDown,
150152
onFocus: () => state.setFocused(true),
151153
onBlur: () => state.setFocused(false)

packages/@react-aria/calendar/src/useCalendarCell.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ import {PressProps, usePress} from '@react-aria/interactions';
1919
import {useDateFormatter, useMessageFormatter} from '@react-aria/i18n';
2020

2121
export interface AriaCalendarCellProps {
22-
date: CalendarDate
22+
date: CalendarDate,
23+
colIndex: number
2324
}
2425

2526
interface CalendarCellAria {
@@ -28,7 +29,7 @@ interface CalendarCellAria {
2829
}
2930

3031
export function useCalendarCell(props: AriaCalendarCellProps, state: CalendarState | RangeCalendarState, ref: RefObject<HTMLElement>): CalendarCellAria {
31-
let {date} = props;
32+
let {colIndex, date} = props;
3233
let formatMessage = useMessageFormatter(intlMessages);
3334
let dateFormatter = useDateFormatter({
3435
weekday: 'long',
@@ -107,6 +108,7 @@ export function useCalendarCell(props: AriaCalendarCellProps, state: CalendarSta
107108
cellProps: {
108109
onMouseEnter: isDisabled ? null : onMouseEnter,
109110
role: 'gridcell',
111+
'aria-colindex': colIndex,
110112
'aria-disabled': isDisabled || null,
111113
'aria-selected': isSelected
112114
},
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
interface CalendarTableHeaderAria {
2+
columnHeaderProps: {scope?: 'col'}
3+
}
4+
5+
export function useCalendarTableHeader(): CalendarTableHeaderAria {
6+
return {
7+
columnHeaderProps: {
8+
scope: 'col'
9+
}
10+
};
11+
}

packages/@react-aria/datepicker/intl/ar-AE.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"calendar": "التقويم",
3+
"currentDate": "{date, date, full}",
4+
"currentDateRange": "{start, date, long} إلى {end, date, long}",
35
"date": "التاريخ",
46
"dateRange": "نطاق التاريخ",
57
"day": "اليوم",

packages/@react-aria/datepicker/intl/bg-BG.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"calendar": "Календар",
3+
"currentDate": "{date, date, full}",
4+
"currentDateRange": "{start, date, long} до {end, date, long}",
35
"date": "Дата",
46
"dateRange": "Времеви интервал",
57
"day": "Ден",

packages/@react-aria/datepicker/intl/cs-CZ.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"calendar": "Kalendář",
3+
"currentDate": "{date, date, full}",
4+
"currentDateRange": "{start, date, long} až {end, date, long}",
35
"date": "Datum",
46
"dateRange": "Rozsah dat",
57
"day": "Den",

packages/@react-aria/datepicker/intl/da-DK.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"calendar": "Kalender",
3+
"currentDate": "{date, date, full}",
4+
"currentDateRange": "{start, date, long} til {end, date, long}",
35
"date": "Dato",
46
"dateRange": "Datointerval",
57
"day": "Dag",

packages/@react-aria/datepicker/intl/de-DE.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"calendar": "Kalender",
3+
"currentDate": "{date, date, full}",
4+
"currentDateRange": "{start, date, long} bis {end, date, long}",
35
"date": "Datum",
46
"dateRange": "Datumsbereich",
57
"day": "Tag",

packages/@react-aria/datepicker/intl/el-GR.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"calendar": "Ημερολόγιο",
3+
"currentDate": "{date, date, full}",
4+
"currentDateRange": "{start, date, long} έως {end, date, long}",
35
"date": "Ημερομηνία",
46
"dateRange": "Εύρος ημερομηνιών",
57
"day": "Ημέρα",

0 commit comments

Comments
 (0)