Skip to content

Commit

Permalink
Merged in bugfix/SHIBUI-713 (pull request #161)
Browse files Browse the repository at this point in the history
SHIBUI-713: Associated labels with form elements to meet accessibility guidelines;

Approved-by: Shibui Jenkins <shibui.jenkins@gmail.com>
Approved-by: Ryan Mathis <rmathis@unicon.net>
  • Loading branch information
Jodie Muramoto authored and rmathis committed Aug 15, 2018
1 parent 0d4c976 commit 6445b05
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 deletions ui/src/app/schema-form/widget/number/number.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
[attr.placeholder]="schema.placeholder"
[attr.maxLength]="schema.maxLength || null"
[attr.minLength]="schema.minLength || null"
[attr.step]="schema.multipleOf || schema.widget.step">
</div>
[attr.step]="schema.multipleOf || schema.widget.step"
[attr.aria-label]="schema.title">
</div>
5 changes: 3 additions & 2 deletions ui/src/app/schema-form/widget/select/select.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
<select *ngIf="schema.type !== 'array'"
[formControl]="control"
[attr.name]="name"
class="form-control">
class="form-control"
[attr.aria-label]="schema.title">
<option disabled selected>{{ schema.placeholder || schema.title }}</option>
<option *ngFor="let option of schema.oneOf" [ngValue]="option.enum[0]">{{option.description}}</option>
</select>
<select *ngIf="schema.type === 'array'" multiple [formControl]="control" [attr.name]="name" [attr.disabled]="schema.readOnly" class="form-control">
<option *ngFor="let option of schema.items.oneOf" [ngValue]="option.enum[0]">{{option.description}}</option>
</select>
<input *ngIf="schema.readOnly" [attr.name]="name" type="hidden" [formControl]="control">
</div>
</div>
3 changes: 2 additions & 1 deletion ui/src/app/schema-form/widget/string/string.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
[attr.placeholder]="schema.placeholder"
[attr.maxLength]="schema.maxLength || null"
[attr.minLength]="schema.minLength || null"
[attr.disabled]="(schema.widget.id=='color' && schema.readOnly)?true:null">
[attr.disabled]="(schema.widget.id=='color' && schema.readOnly)?true:null"
[attr.aria-label]="schema.title">
<input *ngIf="(schema.widget.id === 'color' && schema.readOnly)" [attr.name]="name" type="hidden" [formControl]="control">
<small class="form-text text-danger" *ngIf="errorMessages && errorMessages.length && control.touched">
{{ errorMessages }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
[attr.maxLength]="schema.maxLength || null"
[attr.minLength]="schema.minLength || null"
[rows]="schema.widget.rows || 5"
[formControl]="control"></textarea>
</div>
[formControl]="control"
[attr.aria-label]="schema.title"></textarea>
</div>
1 change: 1 addition & 0 deletions ui/src/app/shared/autocomplete/autocomplete.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
[attr.aria-activedescendant]="activeDescendant"
[placeholder]="placeholder"
attr.aria-owns="{{ id }}__listbox"
[attr.aria-labelledby]="id"
(focus)="handleInputFocus()"
(blur)="handleInputBlur()"
/>
Expand Down

0 comments on commit 6445b05

Please sign in to comment.