--- title: TransitionGroup FLIP Animations Do Not Work With Inline Elements impact: MEDIUM impactDescription: Move animations silently fail on inline elements, causing items to jump type: gotcha tags: [vue3, transition-group, animation, flip, css, display, inline-block] --- # TransitionGroup FLIP Animations Do Not Work With Inline Elements **Impact: MEDIUM** - The FLIP (First, Last, Invert, Play) animation technique that Vue uses for `` move transitions does not work with elements that have `display: inline`. The move animation will silently fail, and items will jump to their new positions instead of smoothly transitioning. This is a CSS limitation, not a Vue bug. CSS transforms (which FLIP uses internally) do not apply to inline elements per the CSS specification. ## Task Checklist - [ ] Ensure list items are not `display: inline` elements - [ ] Use `display: inline-block` or `display: block` for list items - [ ] Use flexbox or grid containers which make children block-level - [ ] Check if inherited styles are setting `display: inline` **Incorrect - Inline elements break move animations:** ```vue ``` **Correct - Use inline-block:** ```vue ``` **Correct - Use flexbox container:** ```vue ``` **Correct - Use block elements:** ```vue ``` ## Why Inline Elements Don't Work Per CSS specifications, the `transform` property does not apply to inline boxes. Since FLIP animations use CSS transforms to animate element positions: ```css /* Vue internally applies something like this during move */ .item { transform: translateX(-50px) translateY(-20px); /* Then transitions to transform: none */ } ``` This transform is ignored on inline elements, so no animation occurs. ## Elements That Are Inline by Default Be aware of these common inline elements that need `display: inline-block`: - `` - `` - ``, ``, ``, `` - ``, `` - `