I have a custom panel widget in WAB Developer edition. On the panel is a dijit/form/Button. It has a css class that gives it a color. It also has a label "Start Tool." There is a data-dojo-attach-event = "onClick:mytogglefunction."
In my widget code I have mytogglefunction, which uses an if/else pattern to look for the label state and change it to a different label "Stop Tool" and also change the css class (so button gets a different color when clicked and activated.)
Problem: user clicks once on button. Label changes immediately onclick, but css color doesn't change until the mouse pointer rolls off the button. So there are essentially 2 events happening -- the click, then the onmouseout.
As I understand it, this is not a css :hover problem. I want the css to update on one onclick.
I created a similar button in a CMV application that worked fine -- but I don't know what is controlling this behavior in WAB.
Help! Thank you!