Skip to content

Commit

Permalink
fix: prefer unprefixed style attributes over prefixed one (#50)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
donnguyen authored May 23, 2024
1 parent 22ae390 commit 0b74cce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions projects/ngx-datatable/src/lib/utils/prefixes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 0b74cce

Please sign in to comment.