Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
Removed labeled-by attribute from file input (#223)
Browse files Browse the repository at this point in the history
* Removed labeled-by attribute from file input

* pr feedback

* Update src/app/public/modules/file-attachment/fixtures/file-attachment.component.fixture.ts

Co-authored-by: John Lyons <John.Lyons@blackbaud.com>

Co-authored-by: Alex Kingman <alex.kingman@blackbaud.me>
Co-authored-by: John Lyons <John.Lyons@blackbaud.com>
  • Loading branch information
3 people committed Oct 29, 2020
1 parent 933f4f0 commit 05dd52b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@skyux/inline-form": "4.1.0",
"@skyux/layout": "4.3.0",
"@skyux/lists": "4.3.0",
"@skyux/lookup": "4.6.0",
"@skyux/lookup": "4.7.0",
"@skyux/modals": "4.5.1",
"@skyux/omnibar-interop": "4.0.1",
"@skyux/popovers": "4.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
class="sky-file-attachment-btn sky-btn sky-btn-default"
type="button"
[attr.aria-describedby]="fileDropDescriptionElementId"
[attr.aria-labelledby]="(hasLabelComponent) ? labelElementId : null"
[disabled]="disabled"
(click)="onDropClicked()"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import {
} from '@angular/core';

import {
expect
expect,
expectAsync
} from '@skyux-sdk/testing';

import {
Expand Down Expand Up @@ -1079,8 +1080,16 @@ describe('File attachment', () => {

it('should pass accessibility', async(() => {
fixture.detectChanges();
fixture.whenStable().then(() => {
expect(fixture.nativeElement).toBeAccessible();
fixture.whenStable().then(async () => {
await expectAsync(fixture.nativeElement).toBeAccessible();
});
}));

it('should pass accessibility when label does not match the button text', async(() => {
fixture.componentInstance.labelText = 'Something different';
fixture.detectChanges();
fixture.whenStable().then(async () => {
await expectAsync(fixture.nativeElement).toBeAccessible();
});
}));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<sky-file-attachment-label
*ngIf="showLabel"
>
Choose file
{{ labelText }}
</sky-file-attachment-label>
</sky-file-attachment>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export class FileAttachmentTestComponent implements OnInit {

public fileForm: FormGroup;

public labelText: string = 'Choose file';

public required: boolean = false;

public showLabel: boolean = true;
Expand Down

0 comments on commit 05dd52b

Please sign in to comment.