Hi,
not sure there is a way. I usually resort to manually handle these kind of UI, and it gives me more control in the end.
Else, I would use a toggle instead of a button, then you can definitely control the active state better. you can tweak the look of a toggle to be exactly like a button.
Bye,
Jean