It seems that some controls don't fire the OnChange action when the default value property is set/bound to an output from a component:
The toggle control fires OnChange when bound to a boolean output from the control - as expected
The radio control does NOT fire OnChange when bound - visually it updates fine - it fires if I click manually on the radio
The text input does NOT fire OnChange when bound - visually it updates fine - it fires if I edit and press enter
I haven't tested any more controls, but this seems like a bug unless I've missed something fundamental.
The thought the OnChange was supposed to only fire when the user made the change, otherwise you could create an infinite loop. I just did a quick test and I think the bug is with the Toggle OnChange because I was able to throw it into an infinite loop just changing from true to false to true to false ..........
"The thought the OnChange was supposed to only fire when the user made the change"
Where is this documented? It's not logical. The controls changes visually and the OnChange does not fire??? It should be consistent whether it's updated through a variable or user input. PowerApps checks for many such infinte loops scenarios.
I sure hope they don't fix the "bug" in the toggle control because I was able to work around the inconsistent behavior of the other controls by using the toggle control along with another output variable that sends the real output value.
I was able to create an infinite loop that had my toggle just switching back and forth, so PowerApps didn't catch it.
In the documentation for the Toggle OnChange it says this is how the app responds when the user changes the value of a control.
"Default – The initial value of a control before it is changed by the user."
So, what's the definition of "changed by the user"? If you have a component that changes the default value (through a variable) by clicking a button in the component I would say that it is changed by the user. If it looks like a duck, if it acts like a duck, etc.
I just step into the same trap.
I am using a component successful to get back a specific value.
This value changes the default value (same like a user input directly) of my TextInput Field to a really new value (same value can be ignored because no changes happen). I logically expect now that the OnChange event is triggert on, to save this new value to my collection. But this dont happen and makes a lot of work now useless.
When will this incredible bug be eleminated ?
Because there is no way to trigger an event automatically when get something out of the component.
Thanks for help
Check out the on demand sessions that are available now!
ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.
Features releasing from October 2020 through March 2021
Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!