aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/utils.mjs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils.mjs b/src/utils.mjs
index f30178a..8162aa6 100644
--- a/src/utils.mjs
+++ b/src/utils.mjs
@@ -29,7 +29,7 @@ export const onRemove = (element, callback) => {
29 * @param {Object} options 29 * @param {Object} options
30 * @param {Boolean} options.resume If true, transition starts from rect to DOMRect of element 30 * @param {Boolean} options.resume If true, transition starts from rect to DOMRect of element
31 * @param {Number} options.duration Duration of animation in milliseconds 31 * @param {Number} options.duration Duration of animation in milliseconds
32 * @returns {Animation} https://developer.mozilla.org/en-US/docs/Web/API/Animation 32 * @returns {Animation|null} https://developer.mozilla.org/en-US/docs/Web/API/Animation
33 */ 33 */
34export const animateRectTransition = (element, rect, options = {}) => { 34export const animateRectTransition = (element, rect, options = {}) => {
35 if (!element.parentElement) throw new Error("The node must already be attached"); 35 if (!element.parentElement) throw new Error("The node must already be attached");
@@ -43,7 +43,7 @@ export const animateRectTransition = (element, rect, options = {}) => {
43 const dy = y1 - y2; 43 const dy = y1 - y2;
44 44
45 if (dx === 0 && dy === 0 || rw === Infinity || rh === Infinity) { 45 if (dx === 0 && dy === 0 || rw === Infinity || rh === Infinity) {
46 return; 46 return null;
47 } 47 }
48 48
49 const transform1 = `translate(0, 0) scale(1, 1)`; 49 const transform1 = `translate(0, 0) scale(1, 1)`;