Skip to content

Conversation

94726
Copy link
Contributor

@94726 94726 commented Aug 8, 2024

This fixes #69, by only applying the deltaX/Y when the element seems to have moved either via deltaTop or deltaBottom etc.

FixedAAJump.mp4

I also added a debounce skip to updatePos, for when the animations finish, as it delayed having accurate oldPos.

This caused elements to be offset when triggering auto-animate shortly after the animations ended.
AASlowUpdatePos.mp4

Ultimately this makes it possible to use auto-animate for building trays/bottom-sheets like this

recreation of https://emilkowal.ski/ui/family-tray-system

DynamicBottomSheetWithAutoanimate.mp4

Copy link

vercel bot commented Aug 8, 2024

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
auto-animate Ready Ready Preview Comment Aug 27, 2025 2:55pm

@arjunsahai
Copy link

Hi, thanks for solving #69. I was wondering if there's any way I could help move this PR forward or if there's any additional information needed? @94726

Thanks :)

@94726
Copy link
Contributor Author

94726 commented Sep 18, 2024

Hi, thanks for solving #69. I was wondering if there's any way I could help move this PR forward or if there's any additional information needed? @94726

So this fix itself is pretty much done. But I think it's hard to tell whether this is a sensible approach as there aren't any tests that confirm the expected behavior of auto-animate in general. This might very well break something that I didn't account for as I only checked whether the docs still animate like before. Unfortunately I don't have experience in testing things like this and cannot provide much help.

But if this PR is of use to you, you might aswell try it in your applications @arjunsahai.
As auto-animate is pretty small in size, you could just copy the index.ts in this PR and be good to go.

@justin-schroeder justin-schroeder changed the base branch from master to release/0.8.5 August 27, 2025 14:47
@justin-schroeder justin-schroeder merged commit bf45988 into formkit:release/0.8.5 Aug 27, 2025
1 of 2 checks passed
justin-schroeder added a commit that referenced this pull request Aug 30, 2025
…t failures

- Restored deltaBottom/deltaRight checks to detect anchored elements
- Fixed immediate position updates after animations (debounce=false)
- Restored proper parent coordinate calculations in deletePosition
- Added named export for autoAnimate to fix exports test
- Fixed flaky framework animation tests by ensuring elements are visible
- Added scrollIntoViewIfNeeded and increased wait times for CI reliability

All bottom-jump-fix tests now pass across all browsers
justin-schroeder added a commit that referenced this pull request Sep 5, 2025
* test(e2e): add Playwright visual tests (video + pixel diffs); stabilize animation waits; upload videos in CI

* fix: jumping when aligned at bottom (#69) (#211)

* fix: jumping when aligned at bottom (#69)

* chore: use const instead of let

* test(e2e): add Playwright visual tests (video + pixel diffs); stabilize animation waits; upload videos in CI

---------

Co-authored-by: Justin Schroeder <[email protected]>

* fix: #69 — nice

* Adding bun to installation instructions (#205)

* feat: allow useAutoAnimate with Vue component ref (#186)

This adds support for using `useAutoAnimate` with a component as the parent.  

When you add `ref="parent"` to a component, the element is found at `parent.value.$el`.  This update checks for component elements or a plain HTML element ref.

* feat: adds component support to useAutoAnimate for Vue

* Investigate and resolve auto-animate issues (#225)

* Improve offscreen handling, Vue integration, and cleanup in AutoAnimate

Co-authored-by: justin <[email protected]>

* Add e2e tests for various autoAnimate scenarios and behaviors

Co-authored-by: justin <[email protected]>

* chore: remove playwright report

* Angular 17.1+ support (#206)

* Angular >v17.1 support

* angular example rewrite

* Angular docs change

* Update package.json

* angular pnpm-lock & usage import fix

* ' -> " typo fix

---------

Co-authored-by: Gergely Dremak <[email protected]>
Co-authored-by: Justin Schroeder <[email protected]>

* chore: lockfile bump

* fix: bottom anchored animations

* chore: remove local claude

* fix: restore bottom-aligned animation fix from PR #211 and fix CI test failures

- Restored deltaBottom/deltaRight checks to detect anchored elements
- Fixed immediate position updates after animations (debounce=false)
- Restored proper parent coordinate calculations in deletePosition
- Added named export for autoAnimate to fix exports test
- Fixed flaky framework animation tests by ensuring elements are visible
- Added scrollIntoViewIfNeeded and increased wait times for CI reliability

All bottom-jump-fix tests now pass across all browsers

* fix: add build step to CI and make tests more robust for slow environments

- Added 'pnpm build' step to GitHub Actions workflow before running tests
- Fixed exports test by ensuring dist files are built in CI
- Made framework animation tests more robust with polling approach
- Added browser-specific timeouts for WebKit compatibility
- Increased wait times and retry attempts for slow CI environments

* fix: no nuxt build on ci

* chore: gh caching

---------

Co-authored-by: Maik Kowol <[email protected]>
Co-authored-by: Abi <[email protected]>
Co-authored-by: Marshall Thompson <[email protected]>
Co-authored-by: Gergely Dremák <[email protected]>
Co-authored-by: Gergely Dremak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Animation bug when remove element
3 participants