nathancahill / split

Unopinionated utilities for resizeable split views
https://split.js.org/
MIT License
6.1k stars 448 forks source link

Gutter has wrong position when pages gets refreshed #757

Open esskar opened 2 years ago

esskar commented 2 years ago

I am running in a strange behaviour with react-split and mui

I have a vertical split with two elements

<Split
      direction="vertical"
      sizes={[50, 50]}
      minSize={200}
      style={{ height: "100%" }}
    >
      <List listId={listId} />
      <Detail listId={listId} detailsId={detailsId} />
</Split>

This works fine initially, the DOM renders

<List />
<Gutter />
<Detail />

when i press F5, i suddently get

<Gutter />
<List />
<Detail />

Any clue?

esskar commented 2 years ago

This seems to happen, when the children of the split get replaced, then the Split is not recreated. when one of the children is fragment that can different childs depending of the state

when the children get wrapped in another div, the problem is none. Maybe not a real bug, but something to document maybe