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

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

Closed
4 of 7 tasks
HipyCas opened this issue Jul 3, 2022 · 5 comments
Closed
4 of 7 tasks

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

HipyCas opened this issue Jul 3, 2022 · 5 comments
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@HipyCas
Copy link

HipyCas commented Jul 3, 2022

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

@ionitron-bot ionitron-bot bot added the triage label Jul 3, 2022
@liamdebeasi liamdebeasi self-assigned this Jul 5, 2022
@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels Jul 5, 2022
@liamdebeasi liamdebeasi removed their assignment Jul 5, 2022
@ionitron-bot ionitron-bot bot removed the triage label Jul 5, 2022
@liamdebeasi
Copy link
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.

@sean-perkins sean-perkins changed the title bug: ion-toggle with ion-item not properly toggleling bug: ion-toggle with ion-item not properly toggling Jul 7, 2022
@HipyCas
Copy link
Author

HipyCas commented Aug 31, 2022

Any updates on this?

@liamdebeasi
Copy link
Contributor

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

liamdebeasi added a commit that referenced this issue Nov 29, 2022
resolves #25570, resolves #23213

BREAKING CHANGE:

The `--background` and `--background-checked` variables have been renamed to `--track-background` and `--track-background-checked`, respectively.
@liamdebeasi
Copy link
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.

@ionitron-bot
Copy link

ionitron-bot bot commented Dec 29, 2022

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Dec 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

2 participants