Skip to content

Commit

Permalink
feat: select component a11y changes (#1066)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbadan authored Jun 9, 2020
1 parent 4ec7343 commit 37ec4fa
Show file tree
Hide file tree
Showing 33 changed files with 3,378 additions and 205 deletions.
10 changes: 10 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,16 @@
}
})();

function onSelectClick(controlId) {
let popoverRef = document.getElementById(controlId);

if (popoverRef.getAttribute("aria-hidden") === "true") {
popoverRef.setAttribute("aria-hidden", "false");
} else {
popoverRef.setAttribute("aria-hidden", "true");
}
}

function stepInputValue(inputId, stepDirection) {
let inputRef = document.getElementById(inputId);

Expand Down
139 changes: 87 additions & 52 deletions docs/pages/components/select.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/_listDropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

.#{$block} {
&--dropdown {
@include fd-focus() {
outline: none;
}

.#{$block}__item {
@include list-item-states();

Expand Down
1 change: 1 addition & 0 deletions src/dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ $button: #{$fd-namespace}-button;

@extend %dialog-body;

position: relative;
padding-top: $fd-dialog-body-padding-y;
padding-bottom: $fd-dialog-body-padding-y;
border-radius: $fd-dialog-content-border-radius;
Expand Down
3 changes: 1 addition & 2 deletions src/mixins/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@
}
}

&[readonly],
&.is-readonly {
@include fd-readonly() {
background-color: rgba(242, 242, 242, 0.5); // Hardcoded for IE11 Purposes, there is not callback for RGBA.
background-color: var(--sapField_ReadOnly_Background);
border-color: var(--sapField_ReadOnly_BorderColor);
Expand Down
6 changes: 3 additions & 3 deletions src/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ $block: #{$fd-namespace}-select;

display: block;
padding-right: 0;
min-width: 5rem;

&__control {
@include fd-form-base();
Expand Down Expand Up @@ -53,7 +54,8 @@ $block: #{$fd-namespace}-select;
}
}

&.is-expanded {
&.is-expanded,
&[aria-expanded="true"] {
.#{$block}__button {
background-color: $fd-select-button-active-background;
color: $fd-select-button-active-text-color;
Expand All @@ -75,7 +77,6 @@ $block: #{$fd-namespace}-select;
}
}

&[readonly],
&.is-readonly {
padding-right: $fd-select-padding-x;
padding-left: $fd-select-padding-x;
Expand All @@ -98,7 +99,6 @@ $block: #{$fd-namespace}-select;
padding-left: 0;
}

&[readonly],
&.is-readonly {
padding-right: $fd-select-padding-compact-x;
padding-left: $fd-select-padding-compact-x;
Expand Down
Loading

0 comments on commit 37ec4fa

Please sign in to comment.