-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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: ionChange
event: determine whether it by user interaction
#19651
Comments
Looks like there is an open PR for this: #19509 |
In Ionic 3, I achieved this by using different handlers for the |
Workaround here. |
ionFocus was ok in beta version of ionic 4. ionFocus is triggered only by user. In my case, I have to execute the function only if user touch the toggle:
So, if the property I think it is not normal, why change between version ? or I have an old version of something. I still use cordova. I am with this configuration :
|
ion-toggle
ionChange
event: determine whether it by user interactionionChange
event: determine whether it by user interaction
Hello everyone, we have an open RFC that proposes a change to Please take a moment to review and let us know your thoughts: #25532 |
Hello everyone, this issue has been resolved and will be available in the next major release of Ionic (v7). Any |
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. |
Feature Request
Ionic version:
[x] 4.10
Describe the Feature Request
Add a way to figure out if the
checked
value ofion-toggle
was changed by user interaction or programatically.Describe Preferred Solution
Add a new property to the event object or the
detail
property.Describe Alternatives
ionUserChange
) that only fires on user interaction.detail
.All of these solutions could be expanded to other components.
Related Code
Same request: #17123
Additional Context
My use case: I have a dark mode toggle and on
ionChange
I save the user's preference. Until the user manually sets the toggle I use the OS setting (which I get usingwindow.matchMedia('(prefers-color-scheme: dark)')
). When the OS setting changes the toggle should change as well. But this saves the new value and no longer checks the OS preference.The text was updated successfully, but these errors were encountered: