fix(search-bar): removed the dependency on passing a value for each query

references #247
This commit is contained in:
Brandy Carney
2015-10-12 18:29:45 -04:00
parent d02651fb9a
commit 146e77bab3
2 changed files with 9 additions and 9 deletions

View File

@ -71,8 +71,8 @@ export class SearchBar extends Ion {
}
// If the user passes in a value to the model we should left align
this.shouldLeftAlign = this.ngControl && this.ngControl.value.trim() != '';
this.query = this.ngControl.value;
this.shouldLeftAlign = this.ngControl.value && this.ngControl.value.trim() != '';
this.query = this.ngControl.value || '';
}
/**
@ -107,7 +107,7 @@ export class SearchBar extends Ion {
inputBlurred() {
this.isFocused = false;
this.shouldLeftAlign = this.ngControl && this.ngControl.value.trim() != '';
this.shouldLeftAlign = this.ngControl.value && this.ngControl.value.trim() != '';
if (this.cancelButton) {
this.cancelButton.style.marginRight = "-" + this.cancelWidth + "px";

View File

@ -8,12 +8,12 @@ import {SearchPipe} from 'ionic/components/search-bar/search-bar';
directives: [FORM_DIRECTIVES]
})
class IonicApp {
defaultSearch: string = '';
customPlaceholder: string = '';
defaultCancel: string = '';
customCancel: string = '';
customCancelLong: string = '';
customCancelAction: string = '';
defaultSearch: string;
customPlaceholder: string;
defaultCancel: string;
customCancel: string;
customCancelLong: string;
customCancelAction: string;
clickedCustomAction: boolean = false;
constructor() {