The gray block below should grow in width once with the blue square sticking to the top right corner, then once with the blue square stationary in the top left corner, returning to the original size after each time.

Testing...