Skip to content

Commit

Permalink
Fixed #6760 - Replace href="#" with tabindex="0"
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Oct 25, 2018
1 parent 5001cc6 commit 2045e79
Show file tree
Hide file tree
Showing 28 changed files with 53 additions and 74 deletions.
30 changes: 15 additions & 15 deletions src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ export interface LocaleSettings {
<div class="ui-datepicker-group ui-widget-content" *ngFor="let month of months; let i = index;">
<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all">
<ng-content select="p-header"></ng-content>
<a class="ui-datepicker-prev ui-corner-all" href="#" (click)="navBackward($event)" *ngIf="i === 0">
<a class="ui-datepicker-prev ui-corner-all" tabindex="0" (click)="navBackward($event)" *ngIf="i === 0">
<span class="pi pi-chevron-left"></span>
</a>
<a class="ui-datepicker-next ui-corner-all" href="#" (click)="navForward($event)" *ngIf="numberOfMonths === 1 ? true : (i === numberOfMonths -1)">
<a class="ui-datepicker-next ui-corner-all" tabindex="0" (click)="navForward($event)" *ngIf="numberOfMonths === 1 ? true : (i === numberOfMonths -1)">
<span class="pi pi-chevron-right"></span>
</a>
<div class="ui-datepicker-title">
Expand Down Expand Up @@ -91,63 +91,63 @@ export interface LocaleSettings {
</div>
</div>
<div class="ui-monthpicker" *ngIf="view === 'month'">
<a href="#" *ngFor="let m of monthPickerValues; let i = index" (click)="onMonthSelect($event, i)" class="ui-monthpicker-month" [ngClass]="{'ui-state-active': isMonthSelected(i)}">
<a tabindex="0" *ngFor="let m of monthPickerValues; let i = index" (click)="onMonthSelect($event, i)" class="ui-monthpicker-month" [ngClass]="{'ui-state-active': isMonthSelected(i)}">
{{m}}
</a>
</div>
</ng-container>
<div class="ui-timepicker ui-widget-header ui-corner-all" *ngIf="showTime||timeOnly">
<div class="ui-hour-picker">
<a href="#" (click)="incrementHour($event)">
<a tabindex="0" (click)="incrementHour($event)">
<span class="pi pi-chevron-up"></span>
</a>
<span [ngStyle]="{'display': currentHour < 10 ? 'inline': 'none'}">0</span><span>{{currentHour}}</span>
<a href="#" (click)="decrementHour($event)">
<a tabindex="0" (click)="decrementHour($event)">
<span class="pi pi-chevron-down"></span>
</a>
</div>
<div class="ui-separator">
<a href="#">
<a tabindex="0">
<span class="pi pi-chevron-up"></span>
</a>
<span>:</span>
<a href="#">
<a tabindex="0">
<span class="pi pi-chevron-down"></span>
</a>
</div>
<div class="ui-minute-picker">
<a href="#" (click)="incrementMinute($event)">
<a tabindex="0" (click)="incrementMinute($event)">
<span class="pi pi-chevron-up"></span>
</a>
<span [ngStyle]="{'display': currentMinute < 10 ? 'inline': 'none'}">0</span><span>{{currentMinute}}</span>
<a href="#" (click)="decrementMinute($event)">
<a tabindex="0" (click)="decrementMinute($event)">
<span class="pi pi-chevron-down"></span>
</a>
</div>
<div class="ui-separator" *ngIf="showSeconds">
<a href="#">
<a tabindex="0">
<span class="pi pi-chevron-up"></span>
</a>
<span>:</span>
<a href="#">
<a tabindex="0">
<span class="pi pi-chevron-down"></span>
</a>
</div>
<div class="ui-second-picker" *ngIf="showSeconds">
<a href="#" (click)="incrementSecond($event)">
<a tabindex="0" (click)="incrementSecond($event)">
<span class="pi pi-chevron-up"></span>
</a>
<span [ngStyle]="{'display': currentSecond < 10 ? 'inline': 'none'}">0</span><span>{{currentSecond}}</span>
<a href="#" (click)="decrementSecond($event)">
<a tabindex="0" (click)="decrementSecond($event)">
<span class="pi pi-chevron-down"></span>
</a>
</div>
<div class="ui-ampm-picker" *ngIf="hourFormat=='12'">
<a href="#" (click)="toggleAMPM($event)">
<a tabindex="0" (click)="toggleAMPM($event)">
<span class="pi pi-chevron-up"></span>
</a>
<span>{{pm ? 'PM' : 'AM'}}</span>
<a href="#" (click)="toggleAMPM($event)">
<a tabindex="0" (click)="toggleAMPM($event)">
<span class="pi pi-chevron-down"></span>
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/carousel/carousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {CommonModule} from '@angular/common';
<span class="ui-carousel-button ui-carousel-prev-button pi pi-arrow-circle-left" (click)="onPrevNav()"
[ngClass]="{'ui-state-disabled':(page === 0 && !circular)}" *ngIf="value&&value.length"></span>
<div *ngIf="displayPageLinks" class="ui-carousel-page-links">
<a href="#" (click)="setPageWithLink($event,i)" class="ui-carousel-page-link pi" *ngFor="let links of anchorPageLinks;let i=index" [ngClass]="{'pi-circle-on': page===i, 'pi-circle-off': page !== i}"></a>
<a tabindex="0" (click)="setPageWithLink($event,i)" class="ui-carousel-page-link pi" *ngFor="let links of anchorPageLinks;let i=index" [ngClass]="{'pi-circle-on': page===i, 'pi-circle-off': page !== i}"></a>
</div>
<select *ngIf="displayPageDropdown" class="ui-carousel-dropdown ui-widget ui-state-default ui-corner-left" [value]="page" (change)="onDropdownChange($event.target.value)">
<option *ngFor="let option of selectDropdownOptions" [value]="option" [selected]="value == option">{{option+1}}</option>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/confirmdialog/confirmdialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {Subscription} from 'rxjs';
[@animation]="{value: 'visible', params: {transitionParams: transitionOptions}}" (@animation.start)="onAnimationStart($event)" *ngIf="visible">
<div class="ui-dialog-titlebar ui-widget-header ui-helper-clearfix ui-corner-top">
<span class="ui-dialog-title" *ngIf="header">{{header}}</span>
<a *ngIf="closable" [ngClass]="{'ui-dialog-titlebar-icon ui-dialog-titlebar-close ui-corner-all':true}" href="#" role="button" (click)="close($event)">
<a *ngIf="closable" [ngClass]="{'ui-dialog-titlebar-icon ui-dialog-titlebar-close ui-corner-all':true}" tabindex="0" role="button" (click)="close($event)" (keydown.enter)="close($event)">
<span class="pi pi-fw pi-times"></span>
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/dataview/dataview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,11 @@ export class DataView implements OnInit,AfterContentInit,BlockableUI {
selector: 'p-dataViewLayoutOptions',
template: `
<div [ngClass]="'ui-dataview-layout-options ui-selectbutton ui-buttonset'" [ngStyle]="style" [class]="styleClass">
<a href="#" class="ui-button ui-button-icon-only ui-state-default" (click)="changeLayout($event, 'list')"
<a tabindex="0" class="ui-button ui-button-icon-only ui-state-default" (click)="changeLayout($event, 'list')" (keydown.enter)="changeLayout($event, 'list')"
[ngClass]="{'ui-state-active': dv.layout === 'list'}">
<i class="pi pi-bars ui-button-icon-left"></i>
<span class="ui-button-text ui-clickable">ui-btn</span>
</a><a href="#" class="ui-button ui-button-icon-only ui-state-default" (click)="changeLayout($event, 'grid')"
</a><a tabindex="0" class="ui-button ui-button-icon-only ui-state-default" (click)="changeLayout($event, 'grid')" (keydown.enter)="changeLayout($event, 'grid')"
[ngClass]="{'ui-state-active': dv.layout === 'grid'}">
<i class="pi pi-th-large ui-button-icon-left"></i>
<span class="ui-button-text ui-clickable">ui-btn</span>
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ let idx: number = 0;
<span [attr.id]="id + '-label'" class="ui-dialog-title" *ngIf="headerFacet && headerFacet.first">
<ng-content select="p-header"></ng-content>
</span>
<a *ngIf="closable" [ngClass]="{'ui-dialog-titlebar-icon ui-dialog-titlebar-close ui-corner-all':true}" href="#" role="button" (click)="close($event)" (mousedown)="onCloseMouseDown($event)">
<a *ngIf="closable" [ngClass]="{'ui-dialog-titlebar-icon ui-dialog-titlebar-close ui-corner-all':true}" tabindex="0" role="button" (click)="close($event)" (keydown.enter)="close($event)" (mousedown)="onCloseMouseDown($event)">
<span class="pi pi-times"></span>
</a>
<a *ngIf="maximizable" [ngClass]="{'ui-dialog-titlebar-icon ui-dialog-titlebar-maximize ui-corner-all':true}" href="#" role="button" (click)="toggleMaximize($event)">
<a *ngIf="maximizable" [ngClass]="{'ui-dialog-titlebar-icon ui-dialog-titlebar-maximize ui-corner-all':true}" tabindex="0" role="button" (click)="toggleMaximize($event)" (keydown.enter)="toggleMaximize($event)">
<span [ngClass]="maximized ? 'pi pi-window-minimize' : 'pi pi-window-maximize'"></span>
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/fieldset/fieldset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let idx: number = 0;
<fieldset [attr.id]="id" [ngClass]="{'ui-fieldset ui-widget ui-widget-content ui-corner-all': true, 'ui-fieldset-toggleable': toggleable}" [ngStyle]="style" [class]="styleClass">
<legend class="ui-fieldset-legend ui-corner-all ui-state-default ui-unselectable-text">
<ng-container *ngIf="toggleable; else legendContent">
<a href="#" (click)="toggle($event)" [attr.aria-controls]="id + '-content'" [attr.aria-expanded]="!collapsed" [attr.tabindex]="toggleable ? null : -1">
<a tabindex="0" (click)="toggle($event)" (keydown.enter)="toggle($event)" [attr.aria-controls]="id + '-content'" [attr.aria-expanded]="!collapsed">
<ng-container *ngTemplateOutlet="legendContent"></ng-container>
</a>
</ng-container>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/lightbox/lightbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {DomHandler} from '../dom/domhandler';
[ngClass]="{'ui-helper-hidden':!rightVisible}"><span class="ui-lightbox-nav-icon pi pi-chevron-right"></span></a>
</div>
<div class="ui-lightbox-caption ui-widget-header" [style.display]="captionText ? 'block' : 'none'">
<span class="ui-lightbox-caption-text">{{captionText}}</span><a class="ui-lightbox-close ui-corner-all" href="#" (click)="hide($event)"><span class="pi pi-times"></span></a>
<span class="ui-lightbox-caption-text">{{captionText}}</span><a class="ui-lightbox-close ui-corner-all" tabindex="0" (click)="hide($event)" (keydown.enter)="hide($event)"><span class="pi pi-times"></span></a>
<div style="clear:both"></div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/messages/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {Subscription} from 'rxjs';
'ui-messages-error':(value[0].severity === 'error'),
'ui-messages-success':(value[0].severity === 'success')}"
[ngStyle]="style" [class]="styleClass" [@messageAnimation]="{value: 'visible', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}">
<a href="#" class="ui-messages-close" (click)="clear($event)" *ngIf="closable">
<a tabindex="0" class="ui-messages-close" (click)="clear($event)" (keydown.enter)="clear($event)" *ngIf="closable">
<i class="pi pi-times"></i>
</a>
<span class="ui-messages-icon pi" [ngClass]="icon"></span>
Expand Down
5 changes: 1 addition & 4 deletions src/app/components/multiselect/multiselect.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
top: .375em;
display: block;
border: 0 none;
cursor: pointer;
}

.ui-multiselect-header a.ui-multiselect-all,
Expand All @@ -138,10 +139,6 @@
display: block;
}

.ui-multiselect-header .ui-multiselect-close.ui-state-hover {
padding:0px;
}

.ui-multiselect-footer {
padding: .25em;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const MULTISELECT_VALUE_ACCESSOR: any = {
<input #filterInput type="text" role="textbox" [value]="filterValue||''" (input)="onFilter($event)" class="ui-inputtext ui-widget ui-state-default ui-corner-all" [attr.placeholder]="filterPlaceHolder">
<span class="ui-multiselect-filter-icon pi pi-search"></span>
</div>
<a class="ui-multiselect-close ui-corner-all" href="#" (click)="close($event)">
<a class="ui-multiselect-close ui-corner-all" tabindex="0" (click)="close($event)" (keydown.enter)="close($event)">
<span class="pi pi-times"></span>
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/organizationchart/organizationchart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {PrimeTemplate} from '../common/shared';
<div *ngIf="chart.getTemplateForNode(node)">
<ng-container *ngTemplateOutlet="chart.getTemplateForNode(node); context: {$implicit: node}"></ng-container>
</div>
<a *ngIf="!leaf" href="#" class="ui-node-toggler" (click)="toggleNode($event, node)">
<a *ngIf="!leaf" tabindex="0" class="ui-node-toggler" (click)="toggleNode($event, node)" (keydown.enter)="toggleNode($event, node)">
<i class="ui-node-toggler-icon pi" [ngClass]="{'pi-chevron-down': node.expanded, 'pi-chevron-up': !node.expanded}"></i>
</a>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/app/components/overlaypanel/overlaypanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
-moz-border-radius: 100%;
-webkit-border-radius: 100%;
border-radius: 100%;
cursor: pointer;
}

.ui-overlaypanel-close-icon {
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/overlaypanel/overlaypanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {trigger,state,style,transition,animate,AnimationEvent} from '@angular/an
<div class="ui-overlaypanel-content">
<ng-content></ng-content>
</div>
<a href="#" *ngIf="showCloseIcon" class="ui-overlaypanel-close ui-state-default" (click)="onCloseClick($event)">
<a tabindex="0" *ngIf="showCloseIcon" class="ui-overlaypanel-close ui-state-default" (click)="onCloseClick($event)" (keydown.enter)="hide()">
<span class="ui-overlaypanel-close-icon pi pi-times"></span>
</a>
</div>
Expand Down
20 changes: 10 additions & 10 deletions src/app/components/paginator/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ import {SharedModule} from '../common/shared';
<div class="ui-paginator-left-content" *ngIf="templateLeft">
<ng-container *ngTemplateOutlet="templateLeft; context: {$implicit: paginatorState}"></ng-container>
</div>
<a href="#" class="ui-paginator-first ui-paginator-element ui-state-default ui-corner-all"
(click)="changePageToFirst($event)" [ngClass]="{'ui-state-disabled':isFirstPage()}" [tabindex]="isFirstPage() ? -1 : null">
<a [attr.tabindex]="isFirstPage() ? null : '0'" class="ui-paginator-first ui-paginator-element ui-state-default ui-corner-all"
(click)="changePageToFirst($event)" (keydown.enter)="changePageToFirst($event)" [ngClass]="{'ui-state-disabled':isFirstPage()}" [tabindex]="isFirstPage() ? -1 : null">
<span class="ui-paginator-icon pi pi-step-backward"></span>
</a>
<a href="#" class="ui-paginator-prev ui-paginator-element ui-state-default ui-corner-all"
(click)="changePageToPrev($event)" [ngClass]="{'ui-state-disabled':isFirstPage()}" [tabindex]="isFirstPage() ? -1 : null">
<a tabindex="0" [attr.tabindex]="isFirstPage() ? null : '0'" class="ui-paginator-prev ui-paginator-element ui-state-default ui-corner-all"
(click)="changePageToPrev($event)" (keydown.enter)="changePageToPrev($event)" [ngClass]="{'ui-state-disabled':isFirstPage()}" [tabindex]="isFirstPage() ? -1 : null">
<span class="ui-paginator-icon pi pi-caret-left"></span>
</a>
<span class="ui-paginator-pages">
<a href="#" *ngFor="let pageLink of pageLinks" class="ui-paginator-page ui-paginator-element ui-state-default ui-corner-all"
(click)="onPageLinkClick($event, pageLink - 1)" [ngClass]="{'ui-state-active': (pageLink-1 == getPage())}">{{pageLink}}</a>
<a tabindex="0" *ngFor="let pageLink of pageLinks" class="ui-paginator-page ui-paginator-element ui-state-default ui-corner-all"
(click)="onPageLinkClick($event, pageLink - 1)" (keydown.enter)="onPageLinkClick($event, pageLink - 1)" [ngClass]="{'ui-state-active': (pageLink-1 == getPage())}">{{pageLink}}</a>
</span>
<a href="#" class="ui-paginator-next ui-paginator-element ui-state-default ui-corner-all"
(click)="changePageToNext($event)" [ngClass]="{'ui-state-disabled':isLastPage()}" [tabindex]="isLastPage() ? -1 : null">
<a [attr.tabindex]="isLastPage() ? null : '0'" class="ui-paginator-next ui-paginator-element ui-state-default ui-corner-all"
(click)="changePageToNext($event)" (keydown.enter)="changePageToNext($event)" [ngClass]="{'ui-state-disabled':isLastPage()}" [tabindex]="isLastPage() ? -1 : null">
<span class="ui-paginator-icon pi pi-caret-right"></span>
</a>
<a href="#" class="ui-paginator-last ui-paginator-element ui-state-default ui-corner-all"
(click)="changePageToLast($event)" [ngClass]="{'ui-state-disabled':isLastPage()}" [tabindex]="isLastPage() ? -1 : null">
<a [attr.tabindex]="isLastPage() ? null : '0'" class="ui-paginator-last ui-paginator-element ui-state-default ui-corner-all"
(click)="changePageToLast($event)" (keydown.enter)="changePageToLast($event)" [ngClass]="{'ui-state-disabled':isLastPage()}" [tabindex]="isLastPage() ? -1 : null">
<span class="ui-paginator-icon pi pi-step-forward"></span>
</a>
<p-dropdown [options]="rowsPerPageItems" [(ngModel)]="rows" *ngIf="rowsPerPageOptions"
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/panel/panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ let idx: number = 0;
*ngIf="showHeader" (click)="onHeaderClick($event)">
<span class="ui-panel-title" *ngIf="header">{{header}}</span>
<ng-content select="p-header"></ng-content>
<a *ngIf="toggleable" [attr.id]="id + '-label'" class="ui-panel-titlebar-icon ui-panel-titlebar-toggler ui-corner-all ui-state-default" href="#"
(click)="onIconClick($event)" [attr.aria-controls]="id + '-content'" role="tab" [attr.aria-expanded]="!collapsed">
<a *ngIf="toggleable" [attr.id]="id + '-label'" class="ui-panel-titlebar-icon ui-panel-titlebar-toggler ui-corner-all ui-state-default" tabindex="0"
(click)="onIconClick($event)" (keydown.enter)="onIconClick($event)" [attr.aria-controls]="id + '-content'" role="tab" [attr.aria-expanded]="!collapsed">
<span [class]="collapsed ? expandIcon : collapseIcon"></span>
</a>
</div>
Expand Down
Loading

0 comments on commit 2045e79

Please sign in to comment.