Skip to content

fix(swap-animation): guard against undefined elements when sorting in… - #678

Open
Reyo77 wants to merge 1 commit into
Shopify:mainfrom
Reyo77:fix-swap-animation-empty-container
Open

fix(swap-animation): guard against undefined elements when sorting in…#678
Reyo77 wants to merge 1 commit into
Shopify:mainfrom
Reyo77:fix-swap-animation-empty-container

Conversation

@Reyo77

@Reyo77 Reyo77 commented Aug 22, 2026

Copy link
Copy Markdown

This PR implements or fixes...

Fixes an unhandled TypeError: Cannot read property 'style' of undefined in SwapAnimation when dragging an item into an empty container (or when dragEvent.over is undefined).

Also adds a comprehensive unit test suite in src/Plugins/SwapAnimation/tests/SwapAnimation.test.ts covering vertical and horizontal animations, empty container sorting, transition cleanups, and option handling.

This PR closes the following issues...

Closes #261
Closes #114

Does this PR require the Docs to be updated?

No.

Does this PR require new tests?

Yes, new unit tests added in src/Plugins/SwapAnimation/tests/SwapAnimation.test.ts.

This branch been tested on...

  • Full test suite (16 suites, 228 tests passed)
  • TypeScript compiler (tsc -b)
  • ESLint (eslint ./src ./test --max-warnings 0)
  • Production build (yarn build)

@Reyo77

Reyo77 commented Aug 22, 2026

Copy link
Copy Markdown
Author

I have signed the CLA

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.

SwapAnimation Plugin swapAnimate plugin bug when placing items into an empty container

1 participant