From fa884ee549a71f441caf77d17dadf29191f43e39 Mon Sep 17 00:00:00 2001 From: Johannes Odland <johannes.odland@gmail.com> Date: Sun, 24 Dec 2023 02:22:56 +0100 Subject: [PATCH] Fix bug in animation range name regex --- src/proxy-animation.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/proxy-animation.js b/src/proxy-animation.js index 49d2c487..b099e119 100644 --- a/src/proxy-animation.js +++ b/src/proxy-animation.js @@ -11,6 +11,7 @@ const nativeElementAnimate = window.Element.prototype.animate; const nativeAnimation = window.Animation; export const ANIMATION_RANGE_NAMES = ['entry', 'exit', 'cover', 'contain', 'entry-crossing', 'exit-crossing']; +const rangeNameRegExp = new RegExp(`(${ANIMATION_RANGE_NAMES.join('|')})(?!-)`); class PromiseWrapper { constructor() { @@ -1775,7 +1776,7 @@ function parseTimelineRangeOffset(value, position) { } // Author passed in something like `"cover 100%"` else { - const parts = value.split(new RegExp(`(${ANIMATION_RANGE_NAMES.join('|')})`)).map(part => part.trim()).filter(Boolean); + const parts = value.split(rangeNameRegExp).map(part => part.trim()).filter(Boolean); if (parts.length === 1) { if (ANIMATION_RANGE_NAMES.includes(parts[0])) {