dashkite / vellum

Web Components for Web sites
Other
0 stars 0 forks source link

Improve Splitter Responsiveness And Handling Of Edge Cases #5

Open dyoder opened 1 week ago

dyoder commented 1 week ago

Using flex-basis % to implement the splitter is a cool idea because it avoids layout-related computation. The idea was to let the browser do that since it's really good at it. Another advantage is that using flex-box makes it easier to support vertical splits.

In practice, it's a bit laggy and unpredictable. The former problem is likely due to triggering layouts each time we update the flex-basis. The latter is probably because the clamping function is too imprecise.

We might able to to fix these issues. On the other hand, performing the layout computation is not that bad.

dyoder commented 1 week ago

I've changed my mind. The more I think about it, the more there are a bunch of edge cases for computing the split in pixels (ex: resize events). This already works reasonably well (at least on Chrome; I haven't tested the most recent version on Safari for FF yet). A better approach is probably just to see if we can fine tune things.