Skip to content

Commit

Permalink
189 accessibility reachability per tab and screenreader (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
rojansen authored Aug 28, 2024
1 parent 5259bfa commit 3305f41
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zeta",
"title": "Zeta",
"version": "17.0.5",
"version": "17.0.6",
"private": true,
"engines": {
"node": "^18.13.0 || ^20.9.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,14 @@

<mat-icon
matSuffix
aria-label="{{suffixContent}}"
tabindex="0"
*ngIf="suffixVisible && !readonly"
(mousedown)="suffixMouseDown($event)"
(click)="suffixClick($event)"
(keydown.space)="suffixClick($event)"
[attr.alt]="suffixContent"
xc-tooltip="{{iconTooltip || (suffixContent | xcI18n)}}"
xc-i18n
>{{suffixContent}}</mat-icon>
</mat-form-field>
8 changes: 3 additions & 5 deletions xc/xc-form/xc-form-base/xc-form-baseinput.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,20 @@ export class XcFormBaseInputComponent extends XcFormBaseComponent {
}


suffixClick(event: MouseEvent) {
suffixClick(event: MouseEvent | KeyboardEvent) {
event.stopPropagation();
if (!this.disabled && !this.readonly) {
this.suffixToggled = !this.suffixToggled;

if (this.suffix === 'clear') {
this.formControl.setValue('');
this.formControl.markAsDirty();
} else if (this.suffix === 'nullify') {
this.formControl.setValue(null);
this.formControl.markAsDirty();
} else if (this.suffix === 'password') {
this.type = this.suffixToggled ? 'text' : 'password';
}
if (this.suffix === 'clear' || this.suffix === 'nullify') {
this.formControl.markAsDirty();
this.suffixClickChangedValue(this.suffixUnfocusedInput);
}
}
this.suffixUnfocusedInput = false;
}
Expand Down
3 changes: 3 additions & 0 deletions xc/xc-form/xc-form-input/xc-form-input.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@

<mat-icon
matSuffix
aria-label="{{suffixContent}}"
tabindex="0"
*ngIf="suffixVisible"
(mousedown)="suffixMouseDown($event)"
(click)="suffixClick($event)"
(keydown.space)="suffixClick($event)"
[attr.alt]="suffixContent"
xc-tooltip="{{iconTooltip || (suffixContent | xcI18n)}}"
xc-i18n
Expand Down

0 comments on commit 3305f41

Please sign in to comment.