Jquery event handler "keydown" is called two times

Hi! I’ve noticed some problem when I add (document).on('keydown', ...) after dom load. The callback is fired two times. (i watched call stack, first time without sentryWrapped, second time with sentryWrapped). You can try to paste this and look: (() => {
$(document).on(‘keydown’, () => {
console.log(123);
});
});

By the way, if I delete “on dom load”, i.e.

$(document).on(‘keydown’, () => {
console.log(123);
});

that problem disappears. Any ideas ? Thanks.

P.S. if I change on dom load to setTimeout, the problem doesn’t disappear.
P.S. 2 When I added sentry init after dom load, that problem disappears. (but i think it is not a good solution)