Fixed bug when dragging elements aligned right