Currently when adding/removing position or visual properties from a proxy via the Alloy.addClass() or Alloy.removeClass(), these properties are not reset. To illustrate what I mean, consider the following styles:
If I create an XML UI component like this:
The label will say "I'm in the middle" and be centered. If I add the "right" class to it via Alloy.addClass(), as expected, it will then say "I'll be on the right" and will move to the right side of the screen. If I then use Alloy.removeClass() to remove the "right" class, the expectation would be that it would move back to the center and reset the text to the original. Unfortunately, only the text will be reset since it will be reapplied by the "label" class, but right:0 will remain attached to the proxy, keeping it on the right.
We need to devise a way to automatically, and safely, reset positioning and visual properties on a proxy when removing classes.
The case given above would behave as expected if you set right:null in the "label" style, like this: