Juan Iglesias
Juan Iglesias

Reputation: 121

Why is the `mousedown` event fired only after the full click is complete when cursor is at the edge of the window?

This one is pretty simple to recreate, just add a mousedown event listener to the document like

document.addEventListener('mousedown', () => console.log('mousedown'));

if you click anywhere within the viewport, you should see 'mousedown' logged as expected when the mouse is pressed down.

however, if you click exactly on the edge of the window, for example by setting the window to fullscreen and placing the cursor all the way to one side, you receive this log only when the mouse is released.

i have tried this in Chrome, Firefox and Safari and it works the same.

why is this happening? is there some other event that is delaying the regular firing of the mousedown event?

edit:

This is occurring on macOS Monterey 12.3

Upvotes: 0

Views: 141

Answers (0)

Related Questions