stavroskasidis / BlazorContextMenu

A context menu component for Blazor !
MIT License
532 stars 58 forks source link

Correcting TypeError in Submenu Mouseover Events #156

Closed adrien426 closed 5 months ago

adrien426 commented 5 months ago

Description: Issue #155 involved a TypeError on mouseover events in submenu items, due to currentMenuList.childNodes including non-element nodes like text and comments that don't support event methods.

Solution Implemented: I switched from currentMenuList.childNodes to currentMenuList.children in our code, which targets only HTML element nodes. This effectively resolves the JavaScript error by ensuring event listeners are applied solely to suitable elements. Notably, Blazor Server frequently inserts comment nodes in HTML, which were being mishandled and caused the initial problem.

stavroskasidis commented 5 months ago

Thank you for your contribution