Batch mode ignores animation Position for "To" method (works with "FromTo")

Note: This report was prepared with the assistance of an AI assistant, which also analyzed the plugin code. While I reproduced and tested the behavior described below (see “Tested”), my interpretation of the underlying code may be incorrect. The suspected cause should therefore be treated as a hypothesis for the developers to verify.

Environment

  • Bricksforge: 4.0.2
  • Bricks: 2.4.3

Steps to reproduce

  1. Create one Scroll timeline (Trigger: Scroll, Start “top 85%”), Batch ON,
    with 10 “To” animations targeting elements in 5 different sections
    (e.g. “.faq-home__container > .gsap-hidden”), all with Position “Custom 0”,
    Stagger 0.08.
  2. Load the page and scroll quickly to the bottom.
  3. Elements in the last section appear only after several seconds.

Observed
Inspecting the timeline children in the console after scrolling to the bottom:

  • startTime of the tweens: 0.00, 0.38, 0.76, 1.14, … 5.58
    (each step = duration 0.3 + delay 0.08, i.e. tweens added one after another
    even though every animation has Position “Custom 0”)
  • timeline duration 5.88s while its playhead was at 1.22s

Tested
Changing the same animations from “To” to “FromTo” (same selectors, same
Position “Custom 0”) removes the delay: the animation appears immediately when
I scroll to the bottom. So the problem happens with “To” and not with “FromTo”.
I did NOT test the “From” method.

Where it appears to come from (my reading of assets/js/bricksforge_panel.js,
handleTimeline, switch(n.method) - minified code, so please verify)

  • case “to”, batch branch:
    onEnter: (t,a) => { z.to(t, {…}) }, animationPositionValue: N
    The position N does not seem to be passed to z.to(). It is put into the
    ScrollTrigger.batch() options as “animationPositionValue”, which is not a
    ScrollTrigger option.
  • Non-batch branch: z.to(O, {…}, N) - the position is passed as 3rd argument.
  • case “fromTo”, batch branch: z.fromTo(t, {…}, {…}, N) - position passed.
  • case “from”, batch branch looks like the same pattern as “to” in the code,
    but as said, I haven’t tested it.

Expected
In Batch mode, “To” (and probably “From”) should pass the Position to the
timeline the same way “FromTo” does.

Hi,

thanks for the report, and your reading of the code is correct.

In batch mode, the “To” branch builds the tween as tl.to(elements, {…}) without the position, and the position ends up as an extra key in the ScrollTrigger.batch() options, where GSAP ignores it. So every tween falls back to the default position and gets appended after the previous one, which is exactly the growing delay you measured. The non-batch branch and the “FromTo” batch branch both pass the position correctly.

The “From” method has the same problem in batch mode, so your guess there was right as well.

The fix is small: pass the position to tl.to() and tl.from() in the batch branch, the same way “FromTo” already does it.

Until then, switching those animations to “FromTo”, as you already did, is the right workaround.

Best,
Daniele

1 Like