Skip to content

feat: ionCheck and ionUncheck for ion-checkbox #19096

@mahnuh

Description

@mahnuh

Feature Request

Ionic version:
[x] 4.x

Describe the Feature Request
I want to be able to trigger something when a checkbox is being checked/unchecked. ionChange does not work in some cases, see additional context below.

Describe Preferred Solution
Extend events on ion-checkbox to have ionCheck and ionUncheck, similar to ionSelect and ionDeselect on ion-radio.

Related Code
Working on a PR at the moment.

Additional Context
Let's say I have a list of items. Those items are custom components with a couple of checkboxes each. The data for this list comes from an observable I subscribed to. I use ionChange to detect if one of those checkboxes is being checked/unchecked and the previously mentioned observable is being triggered. This triggers ionChange again which then triggers the observable which then triggers ionChange... and now I am trapped in a pretty nasty endless loop.
I guess there could be more cases when you do not want do use ionChange to determine if a specific checkbox is being checked/unchecked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: replythe issue needs a response from the user

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions