mouseover event bubbling issue -- Javascript

I am writing some pure javascript that requires me to add elements to a flex container dynamically row by row. To my surprise, My mouseover event propagate across the row and trigger the other children even though it shouldn't. Below is my code.

The problem is, whenever i mouseover on an object, it propagate across the row and fires the mouseover event for all the other items on the same row. It does fire one at a time also. I tried to stop propagation by adding the js

stopPropagation()

prop yet nothing change. Please what is causing this and how do i address it? Any help would be appreciated.

The JS logic works just fine after removing the syntax used for getting the variables for size and parentId (which I'm guessing is from JSP). May be the backtick (`) used is the issue.

OR

You are referring to the problem where hovering on first child of the row hides the entire row.

Here, display:none; will be the culprit and you can use visibiliity: hidden; instead.

display: none; will remove the element from the layout, freeing its space taken from the layout and thus, allowing the next element to take up its space.
In the question, hovering on 1st child frees the space which is now taken by the 2nd element. Since your mouse is still at the same position, it will now remove the 2nd element and the cycle goes so on.

visibiliity: hidden; only hides the element while retaining its space in the layout of the page.