Quirks with Web JS
Here I document all the quirks I've encountered while writing Javascript code for web projects.
Mouse events
mouseenterdoesn't bubble likemouseoverevent.clientXandevent.clientYare unreliable and inconsistent for obtaining cursor position. Instead, use{ top, left }fromevent.getBoudingClientRect()
I tried adding a popup element on hover but its positioning was inconsistent. The cursor entering from the top vs from the bottom resulted in different positions for the popup. affected