chakra-ui / ark

Ark UI is a headless UI library with over 45+ components designed to build scalable Design Systems that works for a wide range of JS frameworks.
https://ark-ui.com
MIT License
3.82k stars 112 forks source link

Splitter - crash reading from undefined context when one panel is sufficiently small #2967

Closed Jdyn closed 1 month ago

Jdyn commented 1 month ago

Description

Context becomes undefined after a splitter panel ignores a change in the size prop. Notice in the video there is a minSize on panel b but I am able to resize to zero. This seems to only happen when the panel size is set to be small.

I believe this is the same core issue as #2602.

Note in the video, I should not be able to even drag the panel to zero, since I had just set minSize.

Link to Reproduction (or Detailed Explanation)

https://github.com/user-attachments/assets/c9e81d20-9d43-4808-896e-484a4d124177

Steps to Reproduce

  1. set two panels, panel a size 100, and panel b size 0
  2. resize the panels programmatically, using the size prop (or using setSize I believe)
  3. the new size will be set, but b that was size 0 does not get the updated size
  4. resize b to be zero using the resize trigger, it ignore the size prop
  5. Try to access the splitter context and it is undefined

Ark UI Version

4.0.0

Framework

Browser

Chrome, Edge

Additional Information

sentry log

CleanShot 2024-10-08 at 19 23 50@2x

segunadebayo commented 1 month ago

Hey. Thanks for the detailed report.

Since it’s a duplicate of that issue. I’ll close this and fix them both shortly