Append element to the DOM before calculating its width