docs(core): ionChange will not emit from programmatically changing value (#29407)

Issue number: resolves
https://github.com/ionic-team/ionic-docs/issues/3588

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

The documentation around `ionChange` not being emitted when
programmatically changing the property associated to the "value" is
either inconsistent or missing from certain components.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Adds the documentation to the missing components.
- Makes the documentation consistent across components.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
This commit is contained in:
Sean Perkins
2024-04-26 16:16:16 -04:00
committed by GitHub
parent 6e8bf4914f
commit ca01fe807f
15 changed files with 71 additions and 42 deletions

View File

@ -53,10 +53,9 @@ import type { AccordionGroupChangeEventDetail as IIonAccordionGroupAccordionGrou
export declare interface IonAccordionGroup extends Components.IonAccordionGroup {
/**
* Emitted when the value property has changed
as a result of a user action such as a click.
This event will not emit when programmatically setting
the value property.
* Emitted when the value property has changed as a result of a user action such as a click.
This event will not emit when programmatically setting the `value` property.
*/
ionChange: EventEmitter<CustomEvent<IIonAccordionGroupAccordionGroupChangeEventDetail>>;
}
@ -530,10 +529,9 @@ import type { CheckboxChangeEventDetail as IIonCheckboxCheckboxChangeEventDetail
export declare interface IonCheckbox extends Components.IonCheckbox {
/**
* Emitted when the checked property has changed
as a result of a user action such as a click.
This event will not emit when programmatically
setting the checked property.
* Emitted when the checked property has changed as a result of a user action such as a click.
This event will not emit when programmatically setting the `checked` property.
*/
ionChange: EventEmitter<CustomEvent<IIonCheckboxCheckboxChangeEventDetail>>;
/**
@ -664,6 +662,8 @@ export declare interface IonDatetime extends Components.IonDatetime {
ionCancel: EventEmitter<CustomEvent<void>>;
/**
* Emitted when the value (selected date) has changed.
This event will not emit when programmatically setting the `value` property.
*/
ionChange: EventEmitter<CustomEvent<IIonDatetimeDatetimeChangeEventDetail>>;
/**
@ -1001,6 +1001,8 @@ event fires at a different moment:
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.
This event will not emit when programmatically setting the `value` property.
*/
ionChange: EventEmitter<CustomEvent<IIonInputInputChangeEventDetail>>;
/**
@ -1487,6 +1489,8 @@ import type { PickerColumnChangeEventDetail as IIonPickerColumnPickerColumnChang
export declare interface IonPickerColumn extends Components.IonPickerColumn {
/**
* Emitted when the value has changed.
This event will not emit when programmatically setting the `value` property.
*/
ionChange: EventEmitter<CustomEvent<IIonPickerColumnPickerColumnChangeEventDetail>>;
}
@ -1656,6 +1660,8 @@ import type { RadioGroupChangeEventDetail as IIonRadioGroupRadioGroupChangeEvent
export declare interface IonRadioGroup extends Components.IonRadioGroup {
/**
* Emitted when the value has changed.
This event will not emit when programmatically setting the `value` property.
*/
ionChange: EventEmitter<CustomEvent<IIonRadioGroupRadioGroupChangeEventDetail>>;
}
@ -1692,7 +1698,7 @@ modifies the element's value:
- When the user releases the knob after dragging;
- When the user moves the knob with keyboard arrows
`ionChange` is not fired when the value is changed programmatically.
This event will not emit when programmatically setting the `value` property.
*/
ionChange: EventEmitter<CustomEvent<IIonRangeRangeChangeEventDetail>>;
/**
@ -1922,6 +1928,8 @@ 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.
This event will not emit when programmatically setting the `value` property.
*/
ionChange: EventEmitter<CustomEvent<IIonSearchbarSearchbarChangeEventDetail>>;
/**
@ -1967,8 +1975,9 @@ import type { SegmentChangeEventDetail as IIonSegmentSegmentChangeEventDetail }
export declare interface IonSegment extends Components.IonSegment {
/**
* Emitted when the value property has changed and any
dragging pointer has been released from `ion-segment`.
* Emitted when the value property has changed and any dragging pointer has been released from `ion-segment`.
This event will not emit when programmatically setting the `value` property.
*/
ionChange: EventEmitter<CustomEvent<IIonSegmentSegmentChangeEventDetail>>;
}
@ -2022,6 +2031,8 @@ import type { SelectChangeEventDetail as IIonSelectSelectChangeEventDetail } fro
export declare interface IonSelect extends Components.IonSelect {
/**
* Emitted when the value has changed.
This event will not emit when programmatically setting the `value` property.
*/
ionChange: EventEmitter<CustomEvent<IIonSelectSelectChangeEventDetail>>;
/**
@ -2232,6 +2243,8 @@ export declare interface IonTextarea extends Components.IonTextarea {
* The `ionChange` event is fired when the user modifies the textarea's value.
Unlike the `ionInput` event, the `ionChange` event is fired when
the element loses focus after its value has been modified.
This event will not emit when programmatically setting the `value` property.
*/
ionChange: EventEmitter<CustomEvent<IIonTextareaTextareaChangeEventDetail>>;
/**
@ -2384,8 +2397,9 @@ import type { ToggleChangeEventDetail as IIonToggleToggleChangeEventDetail } fro
export declare interface IonToggle extends Components.IonToggle {
/**
* Emitted when the user switches the toggle on or off. Does not emit
when programmatically changing the value of the `checked` property.
* Emitted when the user switches the toggle on or off.
This event will not emit when programmatically setting the `checked` property.
*/
ionChange: EventEmitter<CustomEvent<IIonToggleToggleChangeEventDetail>>;
/**