I have a “ghost” element that I’m using to simulate dragging an item. On the mouse down event, I want to center the element at the mouse position. Therefore, I do the following:
However, the width is 0 at that point of the code. Is there something I’m missing? Do I have to wait until the end of the frame for the display style change to take effect?
The reason I say that, is the logic works in the subsequent mouse move event callback.