-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Closed
Labels
package: core@ionic/core package@ionic/core packagetype: feature requesta new feature, enhancement, or improvementa new feature, enhancement, or improvement
Description
Feature Request
Ionic version:
[x] 4.10
Describe the Feature Request
Add a way to figure out if the checked
value of ion-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
- Add a new event (e.g.
ionUserChange
) that only fires on user interaction. - Add the original event to
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 using window.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.
kevinboosten, Ovilia, indraraj26 and jayj
Metadata
Metadata
Assignees
Labels
package: core@ionic/core package@ionic/core packagetype: feature requesta new feature, enhancement, or improvementa new feature, enhancement, or improvement