Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading of Splitview state from json adds extra div containers that break layout #721

Open
alhimik45 opened this issue Sep 22, 2024 · 1 comment

Comments

@alhimik45
Copy link

Describe the bug
api.fromJSON loads state of Splitview, but also adds two empty split-view-container divs

To Reproduce
Codesandbox with reproduction. Scroll preview up and you'll find bunch of extra empty space from that unexpected divs. Duplicating api.fromJSON call leads to increased number of empty split-view-container divs

Expected behavior
Extra empty divs are not added to markup

Desktop:

  • Browser Firefox
  • Version 129.0.2
@alhimik45
Copy link
Author

In 2.0.0 still same issue with extra divs with .dv-split-view-container class.

CSS workaround if anybody interested:

/* bug https://github.com/mathuo/dockview/issues/721 workaround */
.your-splitview-class > div.dv-split-view-container:not(:last-child) {
  display: none;
}

Could not be suitable if state restoration is done very often as divs still remain in DOM and can cause memory issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant