mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
fix(search-bar): removed the dependency on passing a value for each query
references #247
This commit is contained in:
@ -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";
|
||||
|
@ -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() {
|
||||
|
Reference in New Issue
Block a user