Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

fix(timepicker): add correct type for meridian button #1541

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/timepicker/test/timepicker.spec.js
Original file line number Diff line number Diff line change
@@ -136,8 +136,13 @@ describe('timepicker directive', function () {
expect(getTimeState()).toEqual(['02', '39', 'PM']);
expect(getModelState()).toEqual([14, 39]);
});

it('meridian button has correct type', function() {
var button = getMeridianButton();
expect(button.attr('type')).toBe('button');
});

it('toggles meridian when arrows are clicked', function() {
it('toggles meridian when button is clicked', function() {
var button = getMeridianButton();

doClick(button);
2 changes: 1 addition & 1 deletion template/timepicker/timepicker.html
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
<td style="width:50px;" class="form-group" ng-class="{'has-error': invalidMinutes}">
<input type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">
</td>
<td ng-show="showMeridian"><button class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}</button></td>
<td ng-show="showMeridian"><button type="button" class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}</button></td>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO btn-primary instead of default is a nicer option, but it's just a subjective opinion, good fix anyway.

</tr>
<tr class="text-center">
<td><a ng-click="decrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>