Skip to content

Commit

Permalink
Updating
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgperry authored and mergatron[bot] committed Jul 14, 2023
1 parent bb3fa04 commit d954844
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 11 additions & 1 deletion packages/framer-motion/src/render/dom/DOMVisualElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,17 @@ export abstract class DOMVisualElement<
}

if (isMounted) {
checkTargetForNewValues(this, target, origin as any)
const newValues = checkTargetForNewValues(
this,
target,
origin as any
)

// If new values have been added, for instance named color values, transform these
if (transformValues && newValues) {
origin = transformValues(origin as any)
}

const parsed = parseDomVariant(this, target, origin, transitionEnd)
transitionEnd = parsed.transitionEnd
target = parsed.target
Expand Down
4 changes: 3 additions & 1 deletion packages/framer-motion/src/render/utils/setters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function checkTargetForNewValues(

const numNewValues = newValueKeys.length

if (!numNewValues) return
if (!numNewValues) return false

for (let i = 0; i < numNewValues; i++) {
const key = newValueKeys[i]
Expand Down Expand Up @@ -140,6 +140,8 @@ export function checkTargetForNewValues(
}
if (value !== null) visualElement.setBaseTarget(key, value)
}

return true
}

export function getOriginFromTransition(key: string, transition: Transition) {
Expand Down

0 comments on commit d954844

Please sign in to comment.