Skip to content

Show products and posts that load after a page change - #283

Merged
amjadr360 merged 2 commits into
mainfrom
fix/2675-animate-router-added-elements
Nov 23, 2026
Merged

amjadr360 merged 2 commits into
mainfrom
fix/2675-animate-router-added-elements

Conversation

@amjadr360

@amjadr360 amjadr360 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

With animations turned on, a shop showed blank product cards after a visitor clicked "Next page". The new products only appeared after a reload. The same happened to posts in a blog list set to change pages without reloading. The theme now animates whatever arrives after the page has loaded. If anything is still waiting to animate after 3 seconds, it shows anyway, so content can no longer stay invisible.

  • The fix is in the animation script and its CSS, which every site loads. Shops that have a saved copy of the shop template are fixed by the theme update without re-saving anything.
  • Products a visitor has already seen don't animate again. Only new ones fade in.
  • If the animation script fails or is blocked, animated content shows after 3 seconds instead of never. When a page is very slow and the script runs later than that, content can show, hide, then animate in. Showing it was the safer default.
  • The shortcut snippet some customers were given still works if left in place, with no errors.
  • Tested on Extendable 2.2.1 with a saved shop template: Next, Previous, page numbers and sorting on the shop, product search results and a paginated blog list. Also checked opening page 2 directly, first-load animations, zoom-in, reduced motion, animations turned off, and opening an animated accordion item (the earlier accordion fix still holds). Masteriyo course lists aren't affected, since they reload the page.
  • The version bump comes with the next release.

Pagination, sorting and filters on a Woo product collection, and on a
core Query Loop with "Force page reload" off, swap results in through
the Interactivity API router without a page load. The new cards still
carry .ext-animate--on, so the head CSS hid them, but the script only
set elements up once on DOMContentLoaded. Page 2 of the shop rendered
blank until a reload.

A MutationObserver now runs the existing per-element setup on newly
added .ext-animate--on elements only, the way WOW.js handles content
added later. The router has no public "region swapped" event, so an
observer is the only hook a plain script has. A full re-scan, as AOS
does, was rejected because it replays cards the visitor already saw.

The hide rule now applies only to elements the script has set up. One
it never sets up is held hidden by a 3s animation and then shows, so a
missed element, a blocked script or a script error can no longer keep
content invisible. On a load where the footer script runs later than
3s, an element can show, hide and then animate in; visible content
was preferred over the risk of content that never appears.

The fix lives in the animation code every site loads, so sites with a
saved copy of the shop template are covered without re-saving it.
The hold rule matched any .ext-animate--on element without the
ext-animate class. Blocks with Interactivity API class directives,
such as accordion items, get their class attribute rebuilt when they
change state, which drops ext-animate. Opening an accordion item that
had already animated hid it again for up to 3s. data-ext-animated
survives the rebuild, which is why the long-lived hide rule already
checks it; the hold rule now checks it too.
@amjadr360
amjadr360 marked this pull request as ready for review November 23, 2026 23:07
@amjadr360
amjadr360 merged commit 0ab7994 into main Nov 23, 2026
1 check passed
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.

1 participant