Skip to content

Popup duplicates when initially opened and page loads directly (Next.js + Framework7-React) #4338

@khaledsAlshibani

Description

@khaledsAlshibani
  • Framework7 version: 8.3.4
  • Framework7-React version: 8.3.4
  • React version: 19.0.0
  • Next.js version: 15.1.7
  • Platform and Target: Web / Chrome / Vercel
  • Live Link or CodeSandbox: https://f7-popup-test.vercel.app/popup

Describe the bug

When the page loads with a popup initially open (opened={true}), multiple popup instances are created.
After closing the popup, another duplicate popup remains visible meaning more than one instance of the same popup exists in the DOM.

Why popup is open by default and why this is needed?
because the popup is controlled through URL query parameters or hash (for example, when a user directly opens a URL like ?popup=open or #popup that should display the popup on load).

To Reproduce

  1. Go to https://f7-popup-test.vercel.app/popup (the popup opens automatically on page load)
  2. Close the popup
  3. Notice that another popup instance remains open, duplicated on initial render

Expected behavior

Only a single popup instance should exist.
If the popup starts open (opened={true}), it should open once and close normally without leaving duplicates.

Actual Behavior

When the popup starts open on page load, multiple popup instances are rendered.
After closing one, another duplicate popup stays open.

Additional context

This is a minimal reproduction built with Next.js 15.1.7 and Framework7-React 8.3.4:
Repository: https://github.com/khaledsAlshibani/f7-popup-test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions