Skip to content

Commit 0c0f32d

Browse files
committed
fix(searchbar): looks good when mode is different
references #8855
1 parent cd0e19a commit 0c0f32d

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/components/searchbar/searchbar.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ import { Debouncer } from '../../util/debouncer';
3030
selector: 'ion-searchbar',
3131
template:
3232
'<div class="searchbar-input-container">' +
33-
'<button ion-button (click)="cancelSearchbar($event)" (mousedown)="cancelSearchbar($event)" clear color="dark" class="searchbar-md-cancel" type="button">' +
34-
'<ion-icon name="arrow-back"></ion-icon>' +
33+
'<button ion-button mode="md" (click)="cancelSearchbar($event)" (mousedown)="cancelSearchbar($event)" clear color="dark" class="searchbar-md-cancel" type="button">' +
34+
'<ion-icon name="md-arrow-back"></ion-icon>' +
3535
'</button>' +
3636
'<div #searchbarIcon class="searchbar-search-icon"></div>' +
3737
'<input #searchbarInput class="searchbar-input" (input)="inputChanged($event)" (blur)="inputBlurred($event)" (focus)="inputFocused($event)" ' +
@@ -40,9 +40,9 @@ import { Debouncer } from '../../util/debouncer';
4040
'[attr.autocomplete]="_autocomplete" ' +
4141
'[attr.autocorrect]="_autocorrect" ' +
4242
'[attr.spellcheck]="_spellcheck">' +
43-
'<button ion-button clear class="searchbar-clear-icon" (click)="clearInput($event)" (mousedown)="clearInput($event)" type="button"></button>' +
43+
'<button ion-button clear class="searchbar-clear-icon" [mode]="_mode" (click)="clearInput($event)" (mousedown)="clearInput($event)" type="button"></button>' +
4444
'</div>' +
45-
'<button ion-button #cancelButton [tabindex]="_isActive ? 1 : -1" clear (click)="cancelSearchbar($event)" (mousedown)="cancelSearchbar($event)" class="searchbar-ios-cancel" type="button">{{cancelButtonText}}</button>',
45+
'<button ion-button #cancelButton mode="ios" [tabindex]="_isActive ? 1 : -1" clear (click)="cancelSearchbar($event)" (mousedown)="cancelSearchbar($event)" class="searchbar-ios-cancel" type="button">{{cancelButtonText}}</button>',
4646
host: {
4747
'[class.searchbar-animated]': 'animated',
4848
'[class.searchbar-has-value]': '_value',

src/components/searchbar/test/basic/main.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ <h5 padding-left> Search - Custom Cancel Button Danger </h5>
2929
<h5 padding-left> Search - Value passed </h5>
3030
<ion-searchbar value="mysearch" showCancelButton (ionInput)="triggerInput($event)" (ionCancel)="onCancelSearchbar($event)" (ionClear)="onClearSearchbar($event)" cancelButtonText="Really Long Cancel" color="dark"></ion-searchbar>
3131

32-
<h5 padding-left> Search - Mode iOS passed </h5>
32+
<h5 padding-left> Search - Mode iOS</h5>
3333
<ion-searchbar mode="ios" animated="true" showCancelButton placeholder="Search"></ion-searchbar>
3434

35-
<h5 padding-left> Search - Mode MD passed </h5>
35+
<h5 padding-left> Search - Mode MD</h5>
3636
<ion-searchbar mode="md" animated="true" showCancelButton placeholder="Search"></ion-searchbar>
3737

38+
<h5 padding-left> Search - Mode WP</h5>
39+
<ion-searchbar mode="wp" animated="true" showCancelButton placeholder="Search"></ion-searchbar>
40+
3841
<p padding>
3942
<button ion-button block (click)="changeValue()">Change Value</button>
4043
</p>

0 commit comments

Comments
 (0)