ph-utils 0.13.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dom.js +15 -12
- package/package.json +1 -1
package/lib/dom.js
CHANGED
@@ -454,22 +454,25 @@ export function transition(el, nameOrProperties, dir = "enter", finish) {
|
|
454
454
|
}
|
455
455
|
if (dir === "enter") {
|
456
456
|
if (nameClass) {
|
457
|
-
el.classList.add(nameClass
|
457
|
+
el.classList.add(nameClass);
|
458
|
+
setTimeout(() => {
|
459
|
+
el.classList.add(activeClass);
|
460
|
+
requestAnimationFrame(() => {
|
461
|
+
el.classList.remove(nameClass);
|
462
|
+
});
|
463
|
+
}, 0);
|
458
464
|
}
|
459
465
|
else {
|
460
466
|
toggleCssProperty(el, nameOrProperties, "set");
|
461
|
-
|
462
|
-
|
463
|
-
|
467
|
+
setTimeout(() => {
|
468
|
+
if (trans.length > 0) {
|
469
|
+
el.style.setProperty("transition", trans.join(", "));
|
470
|
+
}
|
471
|
+
requestAnimationFrame(() => {
|
472
|
+
toggleCssProperty(el, nameOrProperties, "remove");
|
473
|
+
});
|
474
|
+
}, 0);
|
464
475
|
}
|
465
|
-
requestAnimationFrame(() => {
|
466
|
-
if (nameClass) {
|
467
|
-
el.classList.remove(nameClass);
|
468
|
-
}
|
469
|
-
else {
|
470
|
-
toggleCssProperty(el, nameOrProperties, "remove");
|
471
|
-
}
|
472
|
-
});
|
473
476
|
}
|
474
477
|
else {
|
475
478
|
if (nameClass) {
|