Being locked in one direction in decoration mode

This happened pretty much at random whenever I closed the decoration window to move.

Basically, after closing the decoration window I was stuck moving to the left automatically, I could not redirect movement nor stop it. When opening the decoration window, I did stop, but closing it again my character continued moving to the left against my will.

Only when completely exiting the decoration mode and reentering it could I make this bug stop.