feat(searchbar): ionInput now emits value payload (#26831)

resolves #26828

BREAKING CHANGE:

The `detail` payload for the `ionInput` event now on `ion-searchbar` contains an object with the current `value` as well as the native event that triggered `ionInput`.
This commit is contained in:
Liam DeBeasi
2023-02-23 12:15:43 -05:00
committed by GitHub
parent fcfdd9e9ba
commit 865f8de9dc
11 changed files with 55 additions and 34 deletions

View File

@ -1019,7 +1019,7 @@ event is not necessarily fired for each alteration to an element's value.
Depending on the way the users interacts with the element, the `ionChange`
event fires at a different moment:
- When the user commits the change explicitly (e.g. by selecting a date
from a date picker for `<ion-input type="date">`, etc.).
from a date picker for `<ion-input type="date">`, pressing the "Enter" key, etc.).
- When the element loses focus after its value has changed: for elements
where the user's interaction is typing.
*/
@ -1862,21 +1862,23 @@ export class IonSearchbar {
}
import type { SearchbarInputEventDetail as IIonSearchbarSearchbarInputEventDetail } from '@ionic/core';
import type { SearchbarChangeEventDetail as IIonSearchbarSearchbarChangeEventDetail } from '@ionic/core';
export declare interface IonSearchbar extends Components.IonSearchbar {
/**
* Emitted when the `value` of the `ion-searchbar` element has changed.
*/
ionInput: EventEmitter<CustomEvent<KeyboardEvent | null>>;
ionInput: EventEmitter<CustomEvent<IIonSearchbarSearchbarInputEventDetail>>;
/**
* The `ionChange` event is fired for `<ion-searchbar>` elements when the user
modifies the element's value. Unlike the `ionInput` event, the `ionChange`
event is not necessarily fired for each alteration to an element's value.
The `ionChange` event is fired when the element loses focus after its value
has been modified. This includes modifications made when clicking the clear
or cancel buttons.
The `ionChange` event is fired when the value has been committed
by the user. This can happen when the element loses focus or
when the "Enter" key is pressed. `ionChange` can also fire
when clicking the clear or cancel buttons.
*/
ionChange: EventEmitter<CustomEvent<IIonSearchbarSearchbarChangeEventDetail>>;
/**

View File

@ -114,6 +114,7 @@ export {
ScrollCustomEvent,
SearchbarCustomEvent,
SearchbarChangeEventDetail,
SearchbarInputEventDetail,
SegmentChangeEventDetail,
SegmentCustomEvent,
SelectChangeEventDetail,