chore(): revert "feat(select): add event for when overlay is dismissed (#24099)" (#24398)

This reverts commit c1ecf94e4e.
This commit is contained in:
Amanda Smith
2021-12-14 09:05:06 -06:00
committed by GitHub
parent c1ecf94e4e
commit 412e5f168e
7 changed files with 7 additions and 38 deletions

View File

@@ -1568,10 +1568,6 @@ export declare interface IonSelect extends Components.IonSelect {
* Emitted when the selection is cancelled.
*/
ionCancel: EventEmitter<CustomEvent<void>>;
/**
* Emitted when the overlay is dismissed.
*/
ionDismiss: EventEmitter<CustomEvent<void>>;
/**
* Emitted when the select has focus.
*/
@@ -1599,7 +1595,7 @@ export class IonSelect {
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
c.detach();
this.el = r.nativeElement;
proxyOutputs(this, this.el, ["ionChange", "ionCancel", "ionDismiss", "ionFocus", "ionBlur"]);
proxyOutputs(this, this.el, ['ionChange', 'ionCancel', 'ionFocus', 'ionBlur']);
}
}

View File

@@ -1172,7 +1172,6 @@ ion-select,method,open,open(event?: UIEvent | undefined) => Promise<any>
ion-select,event,ionBlur,void,true
ion-select,event,ionCancel,void,true
ion-select,event,ionChange,SelectChangeEventDetail<any>,true
ion-select,event,ionDismiss,void,true
ion-select,event,ionFocus,void,true
ion-select,css-prop,--padding-bottom
ion-select,css-prop,--padding-end

View File

@@ -6147,10 +6147,6 @@ declare namespace LocalJSX {
* Emitted when the value has changed.
*/
"onIonChange"?: (event: CustomEvent<SelectChangeEventDetail>) => void;
/**
* Emitted when the overlay is dismissed.
*/
"onIonDismiss"?: (event: CustomEvent<void>) => void;
/**
* Emitted when the select has focus.
*/

View File

@@ -1385,13 +1385,12 @@ export default defineComponent({
## Events
| Event | Description | Type |
| ------------ | ---------------------------------------- | ------------------------------------------- |
| `ionBlur` | Emitted when the select loses focus. | `CustomEvent<void>` |
| `ionCancel` | Emitted when the selection is cancelled. | `CustomEvent<void>` |
| `ionChange` | Emitted when the value has changed. | `CustomEvent<SelectChangeEventDetail<any>>` |
| `ionDismiss` | Emitted when the overlay is dismissed. | `CustomEvent<void>` |
| `ionFocus` | Emitted when the select has focus. | `CustomEvent<void>` |
| Event | Description | Type |
| ----------- | ---------------------------------------- | ------------------------------------------- |
| `ionBlur` | Emitted when the select loses focus. | `CustomEvent<void>` |
| `ionCancel` | Emitted when the selection is cancelled. | `CustomEvent<void>` |
| `ionChange` | Emitted when the value has changed. | `CustomEvent<SelectChangeEventDetail<any>>` |
| `ionFocus` | Emitted when the select has focus. | `CustomEvent<void>` |
## Methods

View File

@@ -107,11 +107,6 @@ export class Select implements ComponentInterface {
*/
@Event() ionCancel!: EventEmitter<void>;
/**
* Emitted when the overlay is dismissed.
*/
@Event() ionDismiss!: EventEmitter<void>;
/**
* Emitted when the select has focus.
*/
@@ -181,7 +176,6 @@ export class Select implements ComponentInterface {
overlay.onDidDismiss().then(() => {
this.overlay = undefined;
this.isExpanded = false;
this.ionDismiss.emit();
this.setFocus();
});

View File

@@ -10,10 +10,6 @@ test('select: basic', async () => {
// Gender Alert Select
let select = await page.find('#gender');
// add an event spy to the select
const ionDismiss = await select.spyOnEvent('ionDismiss');
await select.click();
let alert = await page.find('ion-alert');
@@ -24,8 +20,6 @@ test('select: basic', async () => {
await alert.callMethod('dismiss');
expect(ionDismiss).toHaveReceivedEvent();
// Skittles Action Sheet Select
select = await page.find('#skittles');
await select.click();
@@ -38,8 +32,6 @@ test('select: basic', async () => {
await actionSheet.callMethod('dismiss');
expect(ionDismiss).toHaveReceivedEvent();
// Custom Alert Select
select = await page.find('#customAlertSelect');
await select.click();
@@ -52,8 +44,6 @@ test('select: basic', async () => {
await alert.callMethod('dismiss');
expect(ionDismiss).toHaveReceivedEvent();
// Custom Popover Select
select = await page.find('#customPopoverSelect');
await select.click();
@@ -82,8 +72,6 @@ test('select: basic', async () => {
await popover.callMethod('dismiss');
expect(ionDismiss).toHaveReceivedEvent();
// Custom Action Sheet Select
select = await page.find('#customActionSheetSelect');
await select.click();
@@ -96,8 +84,6 @@ test('select: basic', async () => {
await actionSheet.callMethod('dismiss');
expect(ionDismiss).toHaveReceivedEvent();
for (const compare of compares) {
expect(compare).toMatchScreenshot();
}

View File

@@ -699,7 +699,6 @@ export const IonSelect = /*@__PURE__*/ defineContainer<JSX.IonSelect>('ion-selec
'value',
'ionChange',
'ionCancel',
'ionDismiss',
'ionFocus',
'ionBlur',
'ionStyle'