Skip to content

Commit 0b74cce

Browse files
authored
fix: prefer unprefixed style attributes over prefixed one (siemens#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.
1 parent 22ae390 commit 0b74cce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

projects/ngx-datatable/src/lib/utils/prefixes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ export function getVendorPrefixedName(property: string) {
3131
const name = camelCase(property);
3232

3333
if (!cache[name]) {
34-
if (prefix !== undefined && testStyle[prefix.css + property] !== undefined) {
35-
cache[name] = prefix.css + property;
36-
} else if (testStyle[property] !== undefined) {
34+
if (testStyle[property] !== undefined) {
3735
cache[name] = property;
36+
} else if (prefix !== undefined && testStyle[prefix.css + property] !== undefined) {
37+
cache[name] = prefix.css + property;
3838
}
3939
}
4040

0 commit comments

Comments
 (0)