The issue glance window extends outside the modal area when the glance is not closed previously

Is it possible to automatically close the glance when the issue modal is closed?

Currently it is so that when you enter issue modal for the first time and open the glance, everything is fine, but if you do not close it and leave it immediately (by clicking outside the modal area) and return again, then the glance goes beyond the modal area (iframe has wrong height).

It turns out that the glance must always be closed before exiting the modal for the iframe height to be correct.