feat(toggle): ionChange will only emit from user committed changes (#26078)

Co-authored-by: Sean Perkins <sean@ionic.io>
This commit is contained in:
Amanda Johnston
2022-10-10 09:55:58 -05:00
committed by GitHub
parent e2cbeeb8ac
commit 85d3bd99be
6 changed files with 27 additions and 16 deletions

View File

@@ -1909,7 +1909,8 @@ export class IonTitle {
import type { ToggleChangeEventDetail as IToggleToggleChangeEventDetail } from '@ionic/core';
export declare interface IonToggle extends Components.IonToggle {
/**
* Emitted when the value property has changed.
* Emitted when the user switches the toggle on or off. Does not emit
when programmatically changing the value of the `checked` property.
*/
ionChange: EventEmitter<CustomEvent<IToggleToggleChangeEventDetail>>;
/**

View File

@@ -39,7 +39,7 @@ describe('Inputs', () => {
cy.get('#reset-button').click();
cy.get('ion-checkbox#first-checkbox').click();
cy.get('ion-toggle').invoke('prop', 'checked', true);
cy.get('ion-toggle').first().click();
cy.get('ion-input').eq(0).type('hola');
cy.get('ion-input input').eq(0).blur();