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.
Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.
Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.
Featuring samples like Return to the Workplace and Emergency Response Applications
Features releasing from October 2020 through March 2021