stavroskasidis / BlazorContextMenu

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

Error when className is not of type string #114

Closed SebastianWachsmuth closed 2 years ago

SebastianWachsmuth commented 2 years ago

For some DOM-Elements className is not of type string (svg for example)

In those cases .split() will throw. same error as #110

could maybe be fixed by using element.classList. it has a contains method

stavroskasidis commented 2 years ago

Ok thank you for reporting this. I will work on it and provide a patch.

SebastianWachsmuth commented 2 years ago

the simplest way, with the fewest changes is to replace line 41 and 63 with var classes = el.classList != undefined ? el.classList : [];

stavroskasidis commented 2 years ago

Changed in 1.13