While working on webpacking pgAdmin4, I had removed `document.removeEventListener(...)` temporarily as it was not working in `strict` mode, giving type error and I forgot to include its fix,
because of this copy/paste functionality didn't work properly which is now taken care in this patch.