Skip to content

"Uncaught Error: Invalid Grid Element" after multiple layout loads with setTimeout and popout windows #1308

@sliva0

Description

@sliva0

Dockview version
6.6.1

Framework
Vanilla JS

Browser
Chromium 148
Vivaldi (Chromium 148)
Firefox 151

Describe the bug
Dockview still logs "Invalid Grid Element" after loading layout with the same popout window twice in a row when they are delayed slightly.

Reproduction
Identical to #1304, but with setTimeouts in the #load-sequence callback instead of synchronous consecutive calls.
src/main.js:

document.querySelector('#load-sequence').addEventListener('click', () => {
  setTimeout(() => api.fromJSON(popoutLayout), 1);
  setTimeout(() => api.fromJSON(popoutLayout), 2);
  setTimeout(() => api.fromJSON(emptyLayout), 3);
});

Expected behavior
No errors in console.

Screenshots / recordings
Chromium:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions