dockview icon indicating copy to clipboard operation
dockview copied to clipboard

Duplicate popouts when page is refreshed

Open borglin opened this issue 1 year ago • 1 comments

Describe the bug When I refresh a page containing a dockview layout with an open popout window it will restore the open popout window and when the stored layout config is loaded it will open another popout window.

To Reproduce I created a repo, https://github.com/borglin/dockview-popout-repro, based on an example from https://dockview.dev/docs/core/groups/popoutGroups/ as that example didn't seem to work.

Steps to reproduce the behavior:

  1. Run npm run vite and open http://localhost:5173/
  2. Click popout on one of the groups
  3. Click save
  4. Refresh page
  5. (Allow popups if blocked by browser and refresh again)
  6. Two popouts are now open

Expected behavior The page refreshes and one copy of the popout is restored

Screenshots Image

Desktop (please complete the following information):

  • OS [MacOS]
  • Browser [Chrome v132, Safari 18.1]
  • Version [3.0.2]

borglin avatar Feb 02 '25 14:02 borglin

I think this is caused by the onReady event being called twice when running <StrictMode> during development, since it is triggered in an effect in the DockviewReact component. This causes App in the example to trigger load twice but the popup window isn't properly closed/cleaned up when the second run opens the popout again.

borglin avatar May 09 '25 10:05 borglin