The browser’s native selection behavior for mouse clicks happens before the click event is fired, so that’s probably what you’re seeing. You could handle mousedown events instead, but that’ll make it a lot more awkward to distinguish between clicks and drags.