From 978fbdd20f82c12c1f239f57f85cd3a866492bac Mon Sep 17 00:00:00 2001 From: TJ Egan Date: Tue, 5 Jan 2021 17:20:33 -0500 Subject: [PATCH 1/2] Revert "fix(dropdown): state disabled background color (#7461)" (#7473) This reverts commit 81aa04f3814631ff8460d6c94bba67ec62ad80a4. Co-authored-by: Josh Black Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/components/docs/sass.md | 3 --- packages/components/src/components/dropdown/_dropdown.scss | 1 - 2 files changed, 4 deletions(-) diff --git a/packages/components/docs/sass.md b/packages/components/docs/sass.md index 0441a29e5f33..3e085f1b6f59 100644 --- a/packages/components/docs/sass.md +++ b/packages/components/docs/sass.md @@ -10623,7 +10623,6 @@ $disabled-01: if( - [accordion [mixin]](#accordion-mixin) - [content-switcher [mixin]](#content-switcher-mixin) - [date-picker [mixin]](#date-picker-mixin) - - [dropdown [mixin]](#dropdown-mixin) - [listbox [mixin]](#listbox-mixin) - [number-input [mixin]](#number-input-mixin) - [search [mixin]](#search-mixin) @@ -20554,7 +20553,6 @@ Dropdown styles } .#{$prefix}--dropdown--disabled { - background-color: $disabled-01; border-bottom-color: transparent; &:hover { @@ -20705,7 +20703,6 @@ Dropdown styles - [selected-ui [variable]](#selected-ui-variable) - [text-02 [variable]](#text-02-variable) - [decorative-01 [variable]](#decorative-01-variable) - - [disabled-01 [variable]](#disabled-01-variable) - [disabled-02 [variable]](#disabled-02-variable) - [carbon--spacing-07 [variable]](#carbon--spacing-07-variable) - [carbon--spacing-04 [variable]](#carbon--spacing-04-variable) diff --git a/packages/components/src/components/dropdown/_dropdown.scss b/packages/components/src/components/dropdown/_dropdown.scss index d7d8c8822d4a..1c1e44383f7f 100644 --- a/packages/components/src/components/dropdown/_dropdown.scss +++ b/packages/components/src/components/dropdown/_dropdown.scss @@ -348,7 +348,6 @@ } .#{$prefix}--dropdown--disabled { - background-color: $disabled-01; border-bottom-color: transparent; &:hover { From 2c3b11b16585b38df871dfd28d53835541666f2b Mon Sep 17 00:00:00 2001 From: DAK <40970507+dakahn@users.noreply.github.com> Date: Tue, 5 Jan 2021 16:44:30 -0600 Subject: [PATCH 2/2] fix(Datepicker): add aria role to Flatpickr dialog (#7465) Co-authored-by: Josh Black Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../src/components/DatePicker/DatePicker.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/react/src/components/DatePicker/DatePicker.js b/packages/react/src/components/DatePicker/DatePicker.js index 55a05476f28f..a2721ae000dc 100644 --- a/packages/react/src/components/DatePicker/DatePicker.js +++ b/packages/react/src/components/DatePicker/DatePicker.js @@ -329,6 +329,7 @@ export default class DatePicker extends Component { onValueUpdate: onHook, }); this.addKeyboardEvents(this.cal); + this.addRoleAttributeToDialog(); } } } @@ -386,6 +387,22 @@ export default class DatePicker extends Component { } }; + /** + * Flatpickr's calendar dialog is not rendered in a landmark causing an + * error with IBM Equal Access Accessibility Checker so we add an aria + * role to the container div. + */ + addRoleAttributeToDialog = () => { + if (this.inputField) { + this.cal.calendarContainer.setAttribute('role', 'region'); + // IBM EAAC requires an aria-label on a role='region' + this.cal.calendarContainer.setAttribute( + 'aria-label', + 'calendar-container' + ); + } + }; + addKeyboardEvents = (cal) => { if (this.inputField) { this.inputField.addEventListener('keydown', (e) => {