79375854

Date: 2025-01-21 20:29:45
Score: 0.5
Natty:
Report link

A little late, but have you checked the actual value of event.target and verified it is the element that you are expecting? The way I handle this is by applying an id to each of the div's you are returning from your subs.map, then in the onMouseLeave function you will check if(e.target.id === expectedID) before running the code.

This prevents the duplicate styling, but doesn't solve the problem of: now your code didn't run on the expected element. I haven't found a good solution for this yet besides replacing the e.target with document.getElementById

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Daniel Crump