fixes #16939 IE hangs when switching between multiple editors / refocusing browser window, the problem also happened on IE8 and IE11.

(cherry picked from commit 95cc48933bef6ed4217a527dae4eef7a83f71059)