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

Removed labeled-by attribute from file input #223

Merged
merged 3 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
Blackbaud-TrevorBurch marked this conversation as resolved.
Show resolved Hide resolved
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