Skip to content

Commit

Permalink
fix(datepicker): adds missing button type attributes (#65)
Browse files Browse the repository at this point in the history
Closes #61
  • Loading branch information
kyubisation authored Jun 28, 2019
1 parent f232240 commit 7b21600
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<button
class="sbb-datepicker-arrow sbb-datepicker-arrow-left"
*ngIf="prevDayActive"
type="button"
class="sbb-datepicker-arrow sbb-datepicker-arrow-left"
[disabled]="disabled"
(click)="prevDay()"
>
Expand All @@ -9,8 +10,9 @@
<sbb-datepicker-toggle *ngIf="toggle"></sbb-datepicker-toggle>
<ng-content></ng-content>
<button
class="sbb-datepicker-arrow sbb-datepicker-arrow-right"
*ngIf="nextDayActive"
type="button"
class="sbb-datepicker-arrow sbb-datepicker-arrow-right"
[disabled]="disabled"
(click)="nextDay()"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,27 +521,4 @@ export class DatepickerComponent<D> implements OnDestroy {
private _getValidDateOrNull(obj: any): D | null {
return this._dateAdapter.isDateInstance(obj) && this._dateAdapter.isValid(obj) ? obj : null;
}

/**
* Manages the 2nd datepicker linked to this instance.
* If the 2nd datepicker has no value, its calendar will open up when filling this datepicker value.
private handleRangeDatepicker(beginDate: D, arrowClick: boolean = false) {
if (this.slave || !beginDate || !this.dateAdapter.isValid(beginDate)) {
return;
}
this.dateRange.begin = beginDate;
this.slave.datepickerInput.min = beginDate;
if (!this.slave.datepickerInput.value && !arrowClick) {
this.slave.open();
} else if (this.dateAdapter.compareDate(beginDate, this.slave.datepickerInput.value) > 0) {
this.slave.datepickerInput.value = null;
if (!arrowClick) {
this.slave.open();
}
} else {
this.dateRange.end = this.slave.datepickerInput.value;
}
}
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}}</span
>, {{ file | fileSizeFormatted }})</span
>
<button class="sbb-file-selector-list-remove-icon" (click)="removeFile(file)">
<button type="button" class="sbb-file-selector-list-remove-icon" (click)="removeFile(file)">
<span
i18n="Hidden button label to remove a file from the selection list@@sbbFileSelectorRemoveFile"
class="cdk-visually-hidden"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ export class LightboxCloseDirective implements OnInit {
selector: 'sbb-lightbox-header, [sbbLightboxHeader]',
template: `
<ng-content></ng-content>
<button sbbLightboxClose *ngIf="!isCloseDisabled" class="sbb-lightbox-close-btn">
<button type="button" sbbLightboxClose *ngIf="!isCloseDisabled" class="sbb-lightbox-close-btn">
<sbb-icon-cross></sbb-icon-cross>
</button>
<button
*ngIf="isCloseDisabled"
type="button"
(click)="emitManualCloseAction()"
class="sbb-lightbox-close-btn"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<ul class="sbb-navigation">
<li class="sbb-navigation-item sbb-navigation-item-left" *ngIf="previousPage">
<button
type="button"
i18n-aria-label="@@navigationPreviousPage"
aria-label="Vorherige Seite"
(click)="pageChange.emit('previous')"
Expand All @@ -16,6 +17,7 @@
</li>
<li class="sbb-navigation-item sbb-navigation-item-right" *ngIf="nextPage">
<button
type="button"
i18n-aria-label="@@navigationNextPage"
aria-label="Nächste Seite"
(click)="pageChange.emit('next')"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<ul class="sbb-pagination">
<li class="sbb-pagination-item">
<button
type="button"
i18n-aria-label="@@paginationPreviousPage"
aria-label="Vorherige Seite"
class="sbb-pagination-item-boundary"
Expand All @@ -19,6 +20,7 @@
<ng-container *ngIf="page !== null">
<button
#pageButton
type="button"
[attr.tabindex]="page === pageIndex ? '-1' : null"
[class.sbb-pagination-item-selected]="page === pageIndex"
[attr.aria-current]="page === pageIndex"
Expand All @@ -30,6 +32,7 @@
</li>
<li class="sbb-pagination-item">
<button
type="button"
i18n-aria-label="@@paginationNextPage"
aria-label="Nächste Seite"
class="sbb-pagination-item-boundary"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<ol class="sbb-processflow-header">
<li *ngFor="let step of steps; let i = index; let isLast = last" class="sbb-processflow-step">
<button
type="button"
[class.sbb-active]="step.active"
[class.sbb-disabled]="step.disabled"
[disabled]="step.disabled"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
>
<button
#label
type="button"
(click)="selectTab(tab)"
(keyup)="onKeyUp($event)"
role="tab"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<ng-content></ng-content>

<button
type="button"
class="sbb-textexpand-button"
[attr.aria-controls]="id"
[attr.aria-expanded]="isExpanded"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ng-content></ng-content>
</div>
<div class="sbb-tooltip-shadow"></div>
<button class="sbb-tooltip-icon" (click)="onClick($event)">
<button type="button" class="sbb-tooltip-icon" (click)="onClick($event)">
<sbb-icon-cross></sbb-icon-cross>
</button>
</ng-template>
Expand Down

0 comments on commit 7b21600

Please sign in to comment.