From acfa6d2c8a19e870ff4efcde6a080476bc29a2b0 Mon Sep 17 00:00:00 2001 From: velzie Date: Tue, 30 Jul 2024 07:21:30 -0400 Subject: [PATCH] temporary hack, we need a full rewrite of element.ts --- src/client/dom/element.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client/dom/element.ts b/src/client/dom/element.ts index fbe16c1..7517374 100644 --- a/src/client/dom/element.ts +++ b/src/client/dom/element.ts @@ -82,6 +82,13 @@ export default function (client: ScramjetClient, self: typeof window) { self.Element.prototype.getAttribute, { apply(target, thisArg, argArray) { + if ( + attrs.includes(argArray[0]) && + thisArg.hasAttribute(`data-${argArray[0]}`) + ) { + return thisArg.getAttribute(`data-${argArray[0]}`); + } + if (attrs.includes(argArray[0]) && thisArg.$origattrs[argArray[0]]) { return thisArg.$origattrs[argArray[0]]; }