Fix workaround for Safari which still has old property name in sl-progress-ring (#914)

pull/928/head
ErikOnBike 2022-09-16 21:14:38 +02:00 zatwierdzone przez GitHub
rodzic 854e576c2c
commit bdf8c4e669
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -43,7 +43,7 @@ export default class SlProgressRing extends ShoelaceElement {
// change, possibly because of a mix of pixel + unit-less values in the calc() function. It seems like a Safari bug,
// but I couldn't pinpoint it so this works around the problem.
//
if (changedProps.has('percentage')) {
if (changedProps.has('value')) {
const radius = parseFloat(getComputedStyle(this.indicator).getPropertyValue('r'));
const circumference = 2 * Math.PI * radius;
const offset = circumference - (this.value / 100) * circumference;