Skip to content

bug: ion-toggle with ion-item not properly toggling #25570

Closed

Description

@HipyCas

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

I have a ion-toggle inside an ion-item as the documentation details, and opposed to what I expected and desire, when I click on the ion-item (not including the ion-toggle) the toggle does not change, only when I click exactly on the toggle.

Expected Behavior

I expected that clicking anywhere on the ion-item would toggle the ion-toggle, as in mobile and even in desktop is pretty difficult and in general uncomfortable clicking exactly the toggle.

Steps to Reproduce

I am using Vue 3, and this is (an adaptation of) the code that I'm using:

<ion-item lines="inset" button :detail="false">
    <ion-label>Toggle</ion-label>
    <ion-toggle v-model="value"></ion-toggle>
</ion-item>

(value is an example variable that would be defined)

Code Reproduction URL

https://github.com/HipyCas/ionic-toggle-reproduction

Ionic Info

Ionic:

   Ionic CLI       : 6.20.1 (/home/hipy/.nvm/versions/node/v18.4.0/lib/node_modules/@ionic/cli)
   Ionic Framework : @ionic/vue 6.0.4

Capacitor:

   Capacitor CLI      : 3.3.2
   @capacitor/android : 3.3.3
   @capacitor/core    : 3.3.2
   @capacitor/ios     : 3.3.3

Utility:

   cordova-res                          : not installed globally
   native-run (update available: 1.6.0) : 1.5.0

System:

   NodeJS : v18.4.0 (/home/hipy/.nvm/versions/node/v18.4.0/bin/node)
   npm    : 8.12.1
   OS     : Linux 5.17

Additional Information

No response

Activity

  1. self-assigned this
    on Jul 5, 2022
  2. added
    package: core
    type: bug
    on Jul 5, 2022
  3. removed their assignment
    on Jul 5, 2022
  4. liamdebeasi commented on Jul 5, 2022

    @liamdebeasi
    Contributor

    Thanks for the issue. This behavior was a design decision made to align with iOS. However, the behavior has been seen as confusing by others, so I think it makes sense to align the ion-toggle behavior with that of other components such as ion-checkbox.

  5. changed the title [-]bug: ion-toggle with ion-item not properly toggleling[/-] [+]bug: ion-toggle with ion-item not properly toggling[/+] on Jul 7, 2022
  6. HipyCas commented on Aug 31, 2022

    @HipyCas
    Author

    Any updates on this?

  7. liamdebeasi commented on Aug 31, 2022

    @liamdebeasi
    Contributor

    We have a proposal for updating the form control API that should fix the issue: #25660

  8. added a commit that references this issue on Nov 29, 2022
    c74901c
  9. liamdebeasi commented on Nov 29, 2022

    @liamdebeasi
    Contributor

    Thanks for the report. In Ionic 7.0 we will be introducing a new ion-toggle syntax that resolves this issue. Details on the syntax change can be found here: #25660

    The work for this was completed in #26357, so I am going to close this issue. We will have a public beta period in the future for developers to test and provide feedback on Ionic 7. Please let me know if there are any questions.

  10. ionitron-bot commented on Dec 29, 2022

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  11. locked and limited conversation to collaborators on Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: coretype: bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions