From 0b74cce12390d1c00bc31d6f7f28dedcc0c9b0a1 Mon Sep 17 00:00:00 2001 From: Don Nguyen Date: Thu, 23 May 2024 21:10:56 +0700 Subject: [PATCH] fix: prefer unprefixed style attributes over prefixed one (#50) This is to fix an issue on Firefox 126 (released May 2024), which no longer support `-moz-transform` but `transform`. But when we get style attributes from an element, `-moz-transform` is still available, which makes our `testStyle` fails. So to resolve this issue, we want to use unprefixed attribute if available. --- projects/ngx-datatable/src/lib/utils/prefixes.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/ngx-datatable/src/lib/utils/prefixes.ts b/projects/ngx-datatable/src/lib/utils/prefixes.ts index 533a42f85..117162a4f 100644 --- a/projects/ngx-datatable/src/lib/utils/prefixes.ts +++ b/projects/ngx-datatable/src/lib/utils/prefixes.ts @@ -31,10 +31,10 @@ export function getVendorPrefixedName(property: string) { const name = camelCase(property); if (!cache[name]) { - if (prefix !== undefined && testStyle[prefix.css + property] !== undefined) { - cache[name] = prefix.css + property; - } else if (testStyle[property] !== undefined) { + if (testStyle[property] !== undefined) { cache[name] = property; + } else if (prefix !== undefined && testStyle[prefix.css + property] !== undefined) { + cache[name] = prefix.css + property; } }