treejs icon indicating copy to clipboard operation
treejs copied to clipboard

Invalid Node Names in Event Handler

Open ForbiddenEra opened this issue 1 year ago • 0 comments

Hi,

The event handler for the nodes has the nodeName properties encoded as all capitals.

HTML specification says lowercase; while this seems to work on plain HTML sites, this breaks the event handler for anything using xHTML.

Unfortunately, this is an inconsistency and mis-implementation by browser vendors that has persisted due to compatibility reasons.

The fix would be to either convert all nodeName properties to upper/lowercase before comparison or using the localName property instead, which correctly returns lowercase values in both cases.

ForbiddenEra avatar Mar 20 '24 05:03 ForbiddenEra