Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(switch): only add focus border if label is not empty
Browse files Browse the repository at this point in the history
Closes #944.
  • Loading branch information
ajoslin committed Dec 15, 2014
1 parent fcb9b2c commit 9c24cc9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/switch/switch-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ md-switch.md-#{$theme-name}-theme {
}

&:focus {
.md-text {
.md-label:not(:empty) {
border-color: black;
border-style: dotted;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/switch/switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function MdSwitch(mdCheckboxDirective, $mdTheming, $mdUtil, $document, $mdConsta
'<div class="md-thumb" md-ink-ripple md-ink-ripple-checkbox></div>' +
'</div>'+
'</div>' +
'<div ng-transclude class="md-text">' +
'<div ng-transclude class="md-label">' +
'</div>',
require: '?ngModel',
compile: compile
Expand Down
5 changes: 3 additions & 2 deletions src/components/switch/switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ md-switch {
margin-right: 8px;
}

.md-text {
border: 1px solid transparent;
.md-label {
border-color: transparent;
border-width: 1px;
}

.md-bar {
Expand Down

0 comments on commit 9c24cc9

Please sign in to comment.