Skip to content

Commit e1fedf6

Browse files
committed
fix: added button type button to all buttons to
1 parent 949f48d commit e1fedf6

File tree

4 files changed

+30
-27
lines changed

4 files changed

+30
-27
lines changed
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<div *ngIf="!isTouch" class="drp-flex drp-space-around">
2-
<button class="drp-btn flat" (click)="yearSelected(year-1)" title="Previous year" aria-label="Previous year"
3-
[disabled]="year === minYear">
2+
<button type="button" class="drp-btn flat" (click)="yearSelected(year-1)" title="Previous year"
3+
aria-label="Previous year" [disabled]="year === minYear">
44
<doublechevronleft></doublechevronleft>
55
</button>
6-
<button class="drp-btn flat" (click)="monthSelected(-1)" title="Previous month" aria-label="Previous month"
7-
[disabled]="year === minYear && month === minMonth">
6+
<button type="button" class="drp-btn flat" (click)="monthSelected(-1)" title="Previous month"
7+
aria-label="Previous month" [disabled]="year === minYear && month === minMonth">
88
<chevronleft></chevronleft>
99
</button>
1010
<label class="mb-0"> {{monthText}} {{year}} </label>
11-
<button class="drp-btn flat next" (click)="monthSelected(1)" title="Next month" aria-label="Next month"
11+
<button type="button" class="drp-btn flat next" (click)="monthSelected(1)" title="Next month" aria-label="Next month"
1212
[disabled]="year === maxYear && month === maxMonth">
1313
<chevronleft></chevronleft>
1414
</button>
15-
<button class="drp-btn flat next" (click)="yearSelected(year+1)" title="Next Year" aria-label="Next Year"
16-
[disabled]="year === maxYear">
15+
<button type="button" class="drp-btn flat next" (click)="yearSelected(year+1)" title="Next Year"
16+
aria-label="Next Year" [disabled]="year === maxYear">
1717
<doublechevronleft></doublechevronleft>
1818
</button>
1919
</div>
@@ -26,22 +26,22 @@
2626
<div class="drp-flex drp-column drp-calendar-column years" *ngIf="isTouch">
2727
<div class="drp-calendar-row" *ngFor="let y of yearsList; let i=index">
2828
<span (click)="yearSelected(y)" [class.active]="year === y">
29-
<button class="drp-btn flat" [attr.aria-label]="y">{{ y }}</button>
29+
<button type="button" class="drp-btn flat" [attr.aria-label]="y">{{ y }}</button>
3030
</span>
3131
</div>
3232
</div>
3333
<div class="drp-flex drp-column drp-calendar-column months" *ngIf="isTouch">
3434
<div class="drp-calendar-row" *ngFor="let m of monthsList;">
3535
<span (click)="monthSelected(m.value)" [class.active]="month === m.value">
36-
<button class=" drp-btn flat" [attr.aria-label]="m.name">{{ m.name }}</button>
36+
<button type="button" class=" drp-btn flat" [attr.aria-label]="m.name">{{ m.name }}</button>
3737
</span>
3838
</div>
3939
</div>
4040
<div class="drp-flex drp-column drp-calendar-column">
4141
<div class="drp-calendar-row" *ngFor="let week of weekList; let i=index">
4242
<span *ngFor="let day of weekList[i]" (click)="dateSelected(day)"
4343
[ngClass]="{'off':!isDateAvailable(day),'active':isSelectedDate(day),'disabled':isDisabled(day)}">
44-
<button class="drp-btn flat" [disabled]="isDisabled(day)"
44+
<button type="button" class="drp-btn flat" [disabled]="isDisabled(day)"
4545
[attr.aria-label]="day | formatDate: srFormat">{{ !isTouch ? day.format('D') : day.format('ddd D') }}</button>
4646
</span>
4747
</div>
@@ -51,7 +51,7 @@
5151
[selectedToDate]="selectedToDate" [minDate]="minDate" [maxDate]="maxDate" [format]="format" [isLeft]="isLeft"
5252
(timeChanged)="dateSelected($event)">
5353
</timepicker>
54-
<button *ngIf="isTouch" (click)="scrollMeOutTop()" class="drp-btn flat next drp-next-calendar-cta" title="Set"
55-
aria-label="Set">
54+
<button type="button" *ngIf="isTouch" (click)="scrollMeOutTop()" class="drp-btn flat next drp-next-calendar-cta"
55+
title="Set" aria-label="Set">
5656
SET <chevronleft></chevronleft>
5757
</button>

projects/angular-datetimerangepicker/src/daterangepicker/daterangepicker.component.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,20 @@
3636
</div>
3737
<div class="my-0 drp-controls">
3838
<div class="drp-flex" [hidden]="derivedOptions.hideControls">
39-
<button [class.hidden]="derivedOptions.autoApply" class="drp-btn apply" [disabled]="!enableApplyButton"
40-
(click)="apply()" type="button">
39+
<button type="button" [class.hidden]="derivedOptions.autoApply" class="drp-btn apply"
40+
[disabled]="!enableApplyButton" (click)="apply()" type="button">
4141
Apply
4242
</button>
43-
<button [class.hidden]="derivedOptions.autoApply" class="drp-btn cancel" (click)="cancel()" type="button">
43+
<button type="button" [class.hidden]="derivedOptions.autoApply" class="drp-btn cancel" (click)="cancel()"
44+
type="button">
4445
Cancel
4546
</button>
46-
<button [disabled]="!this.range" class="drp-btn flat link" (click)="clear()" type="button">
47+
<button type="button" [disabled]="!this.range" class="drp-btn flat link" (click)="clear()" type="button">
4748
Clear
4849
</button>
4950
</div>
5051
<div class="drp-flex range-controls" *ngIf="derivedOptions.showRanges && !derivedOptions.singleCalendar">
51-
<button *ngFor="let range of derivedOptions.preDefinedRanges" class="drp-btn outline"
52+
<button type="button" *ngFor="let range of derivedOptions.preDefinedRanges" class="drp-btn outline"
5253
(click)="applyPredefinedRange(range)" type="button">
5354
{{ range.name }}
5455
</button>

projects/angular-datetimerangepicker/src/time/time-component.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
<div class="drp-flex"
22
[ngClass]="{'col-md-offset-4': options.twentyFourHourFormat, 'col-md-offset-3': !options.twentyFourHourFormat}">
33
<div class="drp-flex drp-column">
4-
<button aria-label="Increment hour by 1" class="drp-btn flat up" [ngClass]="{'disabled': !isValidToAddHour(1)}"
5-
(click)="addHour(1)">
4+
<button type="button" aria-label="Increment hour by 1" class="drp-btn flat up"
5+
[ngClass]="{'disabled': !isValidToAddHour(1)}" (click)="addHour(1)">
66
<chevronleft></chevronleft>
77
</button>
88
<span><b [innerHTML]="getCurrentHour()"></b></span>
9-
<button aria-label="Decrement hour by 1" class="drp-btn flat down" [ngClass]="{'disabled': !isValidToAddHour(-1)}"
10-
(click)="addHour(-1)">
9+
<button type="button" aria-label="Decrement hour by 1" class="drp-btn flat down"
10+
[ngClass]="{'disabled': !isValidToAddHour(-1)}" (click)="addHour(-1)">
1111
<chevronleft></chevronleft>
1212
</button>
1313
</div>
1414
<sub>
1515
<b>h</b>
1616
</sub>
1717
<div class="drp-flex drp-column">
18-
<button aria-label="increment minute by one step" class="drp-btn flat up"
18+
<button type="button" aria-label="increment minute by one step" class="drp-btn flat up"
1919
[ngClass]="{'disabled': !isValidToAddMinute(options.minuteInterval)}" (click)="addMinute(options.minuteInterval)">
2020
<chevronleft></chevronleft>
2121
</button>
2222
<span><b [innerHTML]="getCurrentMinute()" (mouseWheelUp)="addMinute(options.minuteInterval)"></b></span>
23-
<button aria-label="decrement minute by one step" class="drp-btn flat down"
23+
<button type="button" aria-label="decrement minute by one step" class="drp-btn flat down"
2424
[ngClass]="{'disabled': !isValidToAddMinute(-1 * options.minuteInterval)}"
2525
(click)="addMinute(-1 * options.minuteInterval)">
2626
<chevronleft></chevronleft>
@@ -30,11 +30,11 @@
3030
<b>m</b>
3131
</sub>
3232
<div class="drp-flex drp-column ml-2" *ngIf="!options.twentyFourHourFormat">
33-
<button class="drp-btn flat up" (click)="toggleAMPM()">
33+
<button type="button" class="drp-btn flat up" (click)="toggleAMPM()">
3434
<chevronleft></chevronleft>
3535
</button>
3636
<span><b>{{meridiem}}</b></span>
37-
<button class="drp-btn flat down" (click)="toggleAMPM()">
37+
<button type="button" class="drp-btn flat down" (click)="toggleAMPM()">
3838
<chevronleft></chevronleft>
3939
</button>
4040
</div>

src/app/app.component.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,10 @@ <h3>Configuration Options Generator</h3>
184184
<div class="col-xs-12 col-md-3">
185185
<h3>Live Demo</h3>
186186
<div class="col-xs-12">
187-
<daterangepicker [options]="daterangepickerOptions" (rangeSelected)="rangeSelected($event)">
188-
</daterangepicker>
187+
<form action="/">
188+
<daterangepicker [options]="daterangepickerOptions" (rangeSelected)="rangeSelected($event)">
189+
</daterangepicker>
190+
</form>
189191
<div class="col-xs-12 mt-5">
190192
<p class="m-0 p-0">
191193
<strong class="mr-2">Selected Range Data</strong>

0 commit comments

Comments
 (0)