diff --git a/src/components/datetime/datetime.ts b/src/components/datetime/datetime.ts index a808a3299e..a5eb48d08a 100644 --- a/src/components/datetime/datetime.ts +++ b/src/components/datetime/datetime.ts @@ -498,7 +498,7 @@ export class DateTime extends BaseInput implements AfterContentIni picker.addButton({ text: this.cancelText, role: 'cancel', - handler: () => this.ionCancel.emit(null) + handler: () => this.ionCancel.emit(this) }); picker.addButton({ text: this.doneText, diff --git a/src/components/searchbar/searchbar.ts b/src/components/searchbar/searchbar.ts index da472bde14..3f4a23f26f 100644 --- a/src/components/searchbar/searchbar.ts +++ b/src/components/searchbar/searchbar.ts @@ -287,8 +287,8 @@ export class Searchbar extends BaseInput { * Update the Searchbar input value when the input changes */ inputChanged(ev: any) { - this.ionInput.emit(ev); this.value = ev.target.value; + this.ionInput.emit(ev); } /** @@ -331,6 +331,7 @@ export class Searchbar extends BaseInput { let value = this._value; if (isPresent(value) && value !== '') { this.value = ''; // DOM WRITE + this.ionInput.emit(ev); } }, 16 * 4); this._shouldBlur = false; diff --git a/src/components/searchbar/test/basic/pages/root-page/root-page.html b/src/components/searchbar/test/basic/pages/root-page/root-page.html index 9fae1c8900..d05c1fce6e 100644 --- a/src/components/searchbar/test/basic/pages/root-page/root-page.html +++ b/src/components/searchbar/test/basic/pages/root-page/root-page.html @@ -1,33 +1,33 @@
Search - Default
- +
Search - Animated
- +

defaultSearch: {{ defaultSearch }}

Search - Custom Placeholder
- +

customPlaceholder: {{ customPlaceholder }}

Search - No Cancel Button
- +

defaultCancel: {{ defaultCancel }}

Search - Custom Cancel Button Danger
- +
Search - Value passed
- +
Search - Mode iOS
diff --git a/src/components/searchbar/test/basic/pages/root-page/root-page.ts b/src/components/searchbar/test/basic/pages/root-page/root-page.ts index 2e4dfa5f7d..a251e2e4e1 100644 --- a/src/components/searchbar/test/basic/pages/root-page/root-page.ts +++ b/src/components/searchbar/test/basic/pages/root-page/root-page.ts @@ -19,23 +19,27 @@ export class RootPage { } onClearSearchbar(ev: any) { - console.log('ionClear', ev.value); + console.log('ionClear', ev); } onCancelSearchbar(ev: any) { - console.log('ionCancel', ev.value); + console.log('ionCancel', ev); } triggerInput(ev: any) { - console.log('ionInput', ev.value); + console.log('ionInput', ev); + } + + changedInput(ev: any) { + console.log('ionChange', ev); } inputBlurred(ev: any) { - console.log('ionBlur', ev.value); + console.log('ionBlur', ev); } inputFocused(ev: any) { - console.log('ionFocus', ev.value); + console.log('ionFocus', ev); } ngAfterViewInit() {