4 ms·
Then it would make a lot more sense to check event.pointerType == 'mouse' vs event.pointerType == '' (for keyboard)
by shdon 2y ago
Then it would make a lot more sense to check event.pointerType == 'mouse' vs event.pointerType == '' (for keyboard)
- deleted 2y ago[deleted]
- jorams 2y agoThat does seem quite obviously better. Even when insisting on checking coordinates why use the coordinate system carried by the event that you have the least control over. Why not .pageX/.pageY, which can't trigger the failure case as long as you make sure the element isn't in the far top left.