Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(checkbox): ionChange fires on user interaction #25923

Merged
merged 10 commits into from
Sep 13, 2022
Merged

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Sep 12, 2022

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
    • Some docs updates need to be made in the ionic-docs repo, in a separate PR. See the contributing guide for details.
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue URL: N/A internal ticket

What is the new behavior?

  • ion-checkbox now emits ionChange whenever the native change event fires on <input type="checkbox" />.

Does this introduce a breaking change?

  • Yes
  • No

ionChange is no longer emitted when the checked property of ion-checkbox is modified externally. ionChange is only emitted from user committed changes, such as clicking or tapping the checkbox.

Other information

@github-actions github-actions bot added package: angular @ionic/angular package package: core @ionic/core package labels Sep 12, 2022
@liamdebeasi liamdebeasi changed the title Fw 2030 feat(checkbox): ionChange fires on user interaction Sep 12, 2022
@@ -176,6 +188,7 @@ export class Checkbox implements ComponentInterface {
aria-checked={`${checked}`}
disabled={disabled}
id={inputId}
onChange={this.toggleChecked}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open to keeping this as an onClick listener. I did not see any noticeable differences, but using onChange may make the standalone form component change a bit easier for ion-checkbox.

@liamdebeasi liamdebeasi marked this pull request as ready for review September 12, 2022 18:22
@liamdebeasi liamdebeasi requested a review from a team as a code owner September 12, 2022 18:22
@amandaejohnston amandaejohnston requested a review from a team September 13, 2022 18:33
@liamdebeasi liamdebeasi merged commit a6b2629 into feature-7.0 Sep 13, 2022
@liamdebeasi liamdebeasi deleted the FW-2030 branch September 13, 2022 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: angular @ionic/angular package package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants