Skip to content

Commit

Permalink
fix(searchbar): only show clear icon when focused on the searchbar
Browse files Browse the repository at this point in the history
closes #5922
  • Loading branch information
brandyscarney committed Apr 8, 2016
1 parent 0081408 commit ecf9302
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ionic/components/searchbar/searchbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@ ion-searchbar {
}

.searchbar-clear-icon {
display: none;

margin: 0;
padding: 0;

min-height: 0;
}

.searchbar-has-value.searchbar-focused .searchbar-clear-icon {
display: block;
}
2 changes: 1 addition & 1 deletion ionic/components/searchbar/searchbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class SearchbarInput {
'</button>' +
'<div class="searchbar-search-icon"></div>' +
'<input [value]="value" (input)="inputChanged($event)" (blur)="inputBlurred()" (focus)="inputFocused()" class="searchbar-input" type="search" [attr.placeholder]="placeholder" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">' +
'<button clear *ngIf="value" class="searchbar-clear-icon" (click)="clearInput()" (mousedown)="clearInput()"></button>' +
'<button clear class="searchbar-clear-icon" (click)="clearInput()" (mousedown)="clearInput()"></button>' +
'</div>' +
'<button clear (click)="cancelSearchbar()" (mousedown)="cancelSearchbar()" [hidden]="hideCancelButton" class="searchbar-ios-cancel">{{cancelButtonText}}</button>',
directives: [FORM_DIRECTIVES, NgIf, NgClass, Icon, Button, SearchbarInput]
Expand Down

0 comments on commit ecf9302

Please sign in to comment.