Copy code button positioning is sometimes incorrect

Sometimes the "copy code" button for snippets in comments is displayed in the wrong position. For instance, in the video below, for one of the suggestions, the copy code button appears outside of the element. In another suggestion, it doesn't appear at all.

weird_copy_button

I have a feeling this is a transient/difficult to reproduce bug, perhaps due to some kind of layout race condition.

In case it's useful, that video is of these two comments: !89441 (comment 1000402539) and !89441 (comment 1000408288).

Edited by Mark Florian