Skip to content

Cannot auto open more than 1 popup at the same time (regression in v1.21.0) #1377

Description

@marklchaves

Describe the bug

Two popups with the Auto Open trigger can fight over the same animation frame. One popup opens fine. The other popup's animation breaks and it can stay hidden.

Site information

Popup Maker version: v1.21.0 through v1.24.0 (regression present across all of these; confirmed still present in the current stable release, v1.24.0)

WordPress version: 7.1

PHP version: 8.2.27

Expected behavior

Both popups open and animate in.

Current behavior

Only one popup shows a clean open animation. The other popup can flash, skip its animation, or stay hidden.

Steps to reproduce

  1. Create two popups.
  2. Set the Auto Open trigger on both.
  3. Give both the same delay, for example 1000ms.
  4. Load a page where both popups are active.
  5. Watch the page after the delay passes.

Errors

None. This is a visual/animation timing bug, not a script error.

Additional context

When this broke

This worked in versions before v1.21.0.

The v1.21.0 release (2025-09-15) changed the popup open code to fix a different set of animation bugs. The changelog entry says the change aimed to improve browser animation reliability. That change added a forced browser reflow inside initializeState().

A forced reflow happens when code reads a layout property like offsetHeight right after changing styles. The read forces the browser to apply pending style changes right away, instead of waiting for the next paint.

When two Auto Open triggers share the same delay, they fire in the same script tick. The second popup's forced reflow also flushes the first popup's pending opacity: 0 style. This breaks the first popup's animation start state.

Cause

In assets/js/src/site/plugins/pum.js, initializeState() reads $popup[0].offsetHeight and $container[0].offsetHeight right after clearing inline styles. This is a forced synchronous reflow. It runs a full layout pass on the whole page, not just the one popup. So it can touch style changes queued by a second popup that is opening in the same tick.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions