News for hackers. Stuff that matters.
Re:A BBC navigation bar component broke depending on the ext... by shdon on Monday November 18, 2024 @12:08PM (#42174436)
Then it would make a lot more sense to check event.pointerType == 'mouse' vs event.pointerType == '' (for keyboard)
Re:A BBC navigation bar component broke depending on the ext... by jorams on Monday November 18, 2024 @01:22PM (#42175287)
That 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.