Framer Motion adheres to Semantic Versioning.
dragListener
prop to disable drag event listeners.
- Updated documentation for
DragControls.start
.
- Downgraded
api-extractor
to@7.3
as7.7.7
brokeMethod
name indexing.
- Updated documentation for
useDragControls
.
useDragControls
allows imperative initiation of a drag gesture.
- Updated
transformTemplate
to provide an empty string if all transform values are default.
- Changed definition of
staggerDirection
from1 | -1
tonumber
to reduce the need for casting externally-defined types.
- Added support for
TargetResolver
inexit
types.
- Filtering
onAnimationStart
from forwarded props.
- Support for
prefers-reduced-motion
via theuseReducedMotion
hook.
- Various
StrictMode
-related bugs includinglayoutTransition
origin calculation. - Only applying drag constraints during a
useEffect
to allow render-triggered animations a chance to start (thereby blocking the application of constraints).
controls.set
can now accept a function that will resolve once for each child.
- Fixing
ref
hydration inuseLayoutEffect
. (Note: This release effectively reverts1.6.10
. Each child ofAnimatePresence
with a uniquekey
should be given a uniqueref
). - Moving callback ref mutation in
use-drag
anduse-pan-gesture
to auseEffect
.
- Quick start section to README.
- Making position change detection more intelligent.
- Fixing undefined
this.props
error forAnimatePresence.exitBeforeEnter
.
- Support strings in
motion.custom
for Web Component support.
- Inconsistency in handling
x
/y
between SVG and HTML. Now always a shorthand fortranslateX
andtranslateY
.
- Fixing the use of externally-provided
ref
s with single-childAnimatePresence
components.
- Exit variant propagation.
- Cancelling exit animations.
- Fixed exit animation when
animate={useAnimation()}
. - Fixed exit animations when another animation is playing concurrently and finishes first.
- Upgrade
[email protected]
to fixclipPath
in Webkit. - Allow
motion.custom
to accept custom prop types. - Support clicks within draggable components on iOS Safari.
- Making
inherit
public API.
- Restoring React-style behaviour for transform
style
properties when a componentisStatic
.
- Adding
@emotion/is-prop-valid
as an optional dependency to ensure we filter out arbitrary props passed along by Emotion and Styled Components.
- Value-specific
delay
.
- Ensuring
onDragEnd
always fires after ifonDragStart
fired.
- Invalid property in SVGs.
- Making
useInvertedScale
public and changing const to function.
layoutTransition
EventInfo
now passed as second argument toonHoverStart
andonHoverEnd
.useDomEvent
hook for attaching events directly to anElement
.
- Simplifying event system.
- Applying values in
animate.transitionEnd
if not initial animation. - Made drag constraints only apply if a value isn't animating.
- Don't throw error if
useInvertedScale
is provided arguments.
useInvertedScale
for inverting parent scales.
positionTransition
on exiting components withinAnimatePresence
.
- Pan and drag gestures with
PointerEvent
.
AnimatePresence.exitBeforeEnter
.- Added explicit support for custom components as children of
AnimatePresence
.
- Fixing issue with drag constraints (ref-based) being reset, while dragging, on unrelated parent component updates.
- Updated rollup config to list
tslib
as an external dependency. - Ensuring unmounting components don't call
onAnimationComplete
. - Adding error message when no initial value is set, or can be read or inferred.
- Ensuring color alpha is always within bounds.
- Ensuring variants propagate on unmount.
- Added
onAnimationStart
.
- Make sure
select
,input
,textarea
loose focus when blocking default behaviour in a draggable element.
- Value type conversion for currently-hidden elements.
- Fixing unit type conversions when non-positional transforms are applied.
- Fixing variant propagation via
useAnimation()
when the parent component has novariants
prop set. - Fixing unsetting
whileHover
andwhileTap
if they containtransitionEnd
values. - Child components within variant trees now animate to
animate
as set by their parent. - Checking animation props for array variants as well as strings.
- If unencountered value is animated, first attempt to extract an initial value from keyframes definition. Also upgrading
stylefire
to gracefully handle transform requests.
isValidMotionProp
function.
- Improving types for
SVGTextElement
components.
- Don't load
positionTransition
functionality component server-side. - In development mode, ensuring all child keys are unique.
- Typescript to
3.5
.
- Removing re-entering children from exiting list in
AnimatePresence
.
- Supporting
positionTransition
as a function that resolves when the component has moved. - Adding
dragOriginX
anddragOriginY
props.
- Excluding
positionTransition
from SVG type.
- Exporting
AnimatePresenceProps
.
- Fixing
positionTransition
on server-side.
- Upgrade to
AnimatePresence
algo.
- Moving UMD global from
FramerMotion
toMotion
. - Removed
@emotion/is-valid-prop
, saving ~1.9kb from bundle. - Using a slimmed-down version of Popmotion, saving ~3kb from bundle.
- Removing
async
markers, saving ~0.7kb from bundle.
- Cancelling
drag
andpan
gestures on component unmount. - Previously unseen props in
animate
animate correctly. - Fixing reading SVG attributes from DOM.
- Fixed unit type conversion not working with previously-undefined values.
- Calling
onAnimationComplete
whenwhile
overrides are unset. - Preventing initial animation if
animate
is a map of props andinitial={false}
. This went previously unseen as both values were equivalent, butonAnimationComplete
would fire on mount.
AnimatePresence
component for controlling mount/unmount animations.positionTransition
prop for animating when the layout of a component changes.
- Fixing SVG path props.
- Moving SVG path props to
MotionStyle
type. - Changing
MakeMotion
to accept eitherMotionValue<string>
ORMotionValue<number>
.
- Moving
dragConstraints
to a ref if a component re-renders mid gesture. - Only applying
dragConstraints
on render if component isn't currently dragging.
- Making
when
type more permissive for passing in implicitly typed, pre-definedvariants
. - Not blocking default browser behaviour when dragging is initiated on draggable element's
select
,input
,textarea
elements.
- Fixing
useSpring
unsubscriptions.
- Improved SVG support.
- Ensuring each
MotionValue
receives oneMotionValuesMap
update subscriber.
- Adding
x
/y
MotionValue
s to theuseDrag
dependency list. - Ensure hover events only fire as a result of mouse interactions.
- Allowing SVG
motion
components to acceptMotionValue
s via attributes. - Adding SVG attribute types to
Target
.
- Detecting
originZ
as atransform-origin
value.
initial={false}
to shadow contents ofanimate
thereby disabling on mount animation.AnimationControls.set
for imperative setting of values.
- Resolve animations only after a defined
delay
to ensurevelocity
is only resolved as an animation begins on a value.
[email protected]
- ChangesoriginX
/Y
default to"50%"
.
- Production and prototype environment-specific tsdocs.
- Properly cleaning up event listeners in tap gesture.
- Only starting pan gesture when pointer has moved more than one point.
- Applying
transformPagePoint
todragConstraints
when it's aRefObject<Element>
to ensure it works in scaled environments. - Fixing
dragElastic
behaviour whendragMomentum={false}
.
- Preventing default browser behaviours on draggable elements.
- Fixing drag when a multitouch gesture starts.
- Application of
delay
.
- Fixed regex detection for fallbacks containing a decimal.
dragConstraints
can now be set as aReact.RefObject
.
- Support CSS variables with metadata
- Fixing circular CSS dependencies
- Even if a
motion
component wasn't inheriting variant changes, it'd still register with its parent, meaning it'd be considered during stagger duration calculations. - Only firing
onDragEnd
if dragging has actually happened.
dragTransition
now listed as auseDraggable
dependency.
- Experimental
useAnimatedState
Hook for animating arbitrary values.
- Disabling the animation of
zIndex
. - Making components without variants or animation-controlling props invisible to
staggerChildren
.
- API
- Variant propagation when rerendering children
- Using
transition
andtransitionEnd
as direct values on theanimate
prop on subsequent renders. - Rounding
zIndex
. AnimationControls.start
now accepts the sameAnimationDefinition
asValueAnimationControls.start
.
- Cancelling pan gesture when the move events have no mouse button.
- Fixing propagation of unsetting variant overrides.
- Making variant inheritance more permissive.
- Improved handling of attempting to animate between non-animatable and animatable values.
- Adds array and object support to
transform
.
- Makes boxShadow and other complex value type support more robust.
- Fixing overwriting
transform
.
- Updating deps.
shadow
toCustomValueTypes
.
- Fixed propagation of
initial
instatic
mode. - Fixing animations from values that are read as "none".
- Filtering pointer events not from the primary pointer (ie non-left clicks for mouse).
- Fixing drag in Android devices by adding aggressive viewport scroll blocking. This will need dialling back down when it comes to open sourcing Framer Motion so, for instance, a horizontal carousel doesn't block vertical scrolling.
custom
prop for dynamic variants.
useAnimation
no longer takesvariants
ordefaultTransition
arguments (provide these to the component).
- Improving comparison for
animate
prop to account for keyframe arrays. - Adding drag point in
onDragStart
andonDragEnd
callbacks.
- Support for CSS variables.
onDragEnd
not returning transformed point.- Fixing use of
variants
prop withuseAnimation
.
HTMLMotionProps
andSVGMotionProps
.
onPanSessionStart
event handler.
useViewportScrollValues
=>useViewportScroll
.
ease
can now be an array for keyframes animations.
easings
prop.
- Only firing
value.onChange
when value actually changes.
- Updating
hey-listen
.
- Explicit support for the
radius
value.
- Making special value support configurable
useTransformedValue
=>useTransform
transform(value, input, output, options)
overload.
- Added new methods to
safeWindow
SSR window mocking.
- Deleting unused props from
style
object rather than setting toundefined
. #99
size
works withwhile
gestures.
useCycle([...args])
->useCycle(...args)
static
components reflect changes ininitial
.
- Dragging doesn't break during re-renders.
useCycle
setter is independent from render cycle.
useCycle
no longer has the ability to start at a different index.
onDragTransitionEnd
- Popmotion libraries.
value.addUpdateSubscription
=>value.onChange
value.addRenderSubscription
=>value.onRenderRequest
(and made internal)
- Variants propagate to children even if not present on parent.
- Updating docs to avoid single-letter
event
vars.
- Fixing
TargetAndTransform
type to omit CSS-nativerotate
property.
press
->whileTap
hover
->whileHover
- Fixing HTML types.
- Exporting
MotionTransform
type.
- Added support for
CustomValueType
inunwrapMotionValue
.
- Added
dragDirectionLock
prop.
"lockDirection"
fromdragEnabled
.
- Renamed
dragEnabled
todrag
.
- Adding
transition
argument toanimation.start()
.
- No longer fire tap gesture if parent is dragging.
- Adjusting default
inertia
settings to more naturally incorporate velocity. - Killing drag momentum on subsequent
pressDown
. - Preventing pan velocity from adjusting draggable parents that have not received
dragPropagation
. - Updating of
dragConstraints
repositions the draggable element to adhere to the new values
Point.relativeTo
transform
- Statefull style bug.
- Fixing
Promise
resolution withanimate.start()
when fired pre-mount.
- Blocking extra gesture props from being passed to DOM.
- Upgrading
@popmotion/popcorn
to fix Jest bug.
- Fixing
style
set asnull
.
- Adding support for custom values.
- Updating tsdocs for
MotionValue
.
- Updating dependencies.
originX
,originY
,pathLength
,pathOffset
changed from percent to progress value types.
- Exporting
AnimationControls
.
- Exporting
animationControls
andmotionValue
for internal use.
- Passing
panInfo
through toonDragStart
andonDragEnd
.
easings
property onkeyframes
now maps correctly to easing functions.
- Enforcing keyframes animation if target is array.
- Orchestration props in
transition
prop weren't being respected by variants with notransition
of their own.
- Animation targets can be set as
keyframes
.
- Updating
dragConstraints
when they change.
- Removing GPU-acceleration for
static
components. - Adding
customStyles
plugin.
- Exporting
MotionContext
.
- Updated
[email protected]
to improve synchronisation across tweens when yoyoing.
- If
transformPagePoint
is present, transforming initial point.
- Recognising
press
when it's the lone gesture.
- Fixed an issue where values set to
style
would overwriteanimate
values even if they hadn't changed.
static
prop. Setstatic
on a motion component to prevent animation and interaction.
render
- Animating unit-converting values on mount.
- Exporting
MotionComponents
,CustomMotionComponent
,HTMLMotionComponents
andSVGMotionComponents
types. - Exporting
safeWindow
.
onDrag
event listener- Exporting
MotionStyles
type.
tap
->press
- Fixing
originX
andoriginY
SSR. - Updating
style
props to overwrite CSSrotate
,scale
andperspective
.
- Rendering
initial
properties via Stylefire when component mounts to ensure its in-sync with all transform values set ininitial
that might not later be rendered. - Exporting
htmlElements
,svgElements
andcreateMotionComponent
as their exclusion was causing errors with the output declaration file.
- Exporting
useExternalRef
.
- Simplifying inline tsdocs.
- Standardizing
(event, pointInfo)
as signature for gesture callbacks.
- Gesture priority bugs
- Added TSDocs for
useCycle
duration
anddelay
are now defined as seconds.tapActive
->tap
hoverActive
->hover
drag
->dragEnabled