KirkMcDonald / kirkmcdonald.github.io

Simple web-based calculator for the game Factorio.
Apache License 2.0
553 stars 147 forks source link

Fix tooltip getting stuck open in Firefox #169

Open jmerdich opened 5 years ago

jmerdich commented 5 years ago

In firefox and edge (not chrome), the fancy tooltips can get stuck open while ignoring an item if ignoring that item causes it to reorder the ingredients such that the reordered item is no longer under the cursor.

This seems to be caused by the 'mouseleave' event only being triggered if the mouse is moved away from the item in these browsers (not the item being moved away from the mouse). The solution AFAIK is to manually trigger the 'mouseleave' event on icons for rows changing order.

Tested under firefox v68.0.1, chrome 75, and edge 42.17134 under Win10.

Repro steps:

  1. Open in firefox
  2. Load the yellow science recipe
  3. Click the icon for green circuits, keeping the mosue still (ie. ignore it)
  4. Observe that the green circuit tooltip remains open.