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

Resizing stop working if panel to immediate right hit's it's max #181

Closed
hipstersmoothie opened this issue Aug 14, 2023 · 5 comments
Closed

Comments

@hipstersmoothie
Copy link
Contributor

https://codesandbox.io/s/react-resizable-panels-forked-lc3p4d?file=/src/App.js:663-677

If up have a panel on the left that can get smaller but it's sibling is at it's max resizing doesn't seem to work. In this situation it should probably start adding width to the next sibling with more room to grow.

CleanShot.2023-08-14.at.01.15.40.mp4

The panel in the center restricts resizing, but you can use another resizer to continue resizing

@bvaughn
Copy link
Owner

bvaughn commented Aug 14, 2023

This is understandably debatable behavior, but it's a long-standing design decision this library has made. Partly the decision is because I can see both behaviors as being plausible. Partly because I'm not sure how to implement the behavior you're describing as expected (without it being computationally too expensive).

@hipstersmoothie
Copy link
Contributor Author

I'd gladly opt in to it. Otherwise I'll have to patch-package in the behavior myself

@bvaughn
Copy link
Owner

bvaughn commented Aug 14, 2023

I don't want to make that sort of thing configurable. My gut tells me that the added maintenance burden would not justify the feature.

That being said, if you're considering a patch anyway– share it with me? Maybe I'll land it. As I mentioned, I don't feel strongly about the current approach. I was on the fence and I went with the easier option.

I shipped 0.0.55, but I felt frustrated about how much complexity there was validating layouts and sizes, so I started a rewrite on my flight home last night. I'm not done, but I'll push what I have here to share the idea: #182

If you'd like to get this change landed, I'd suggest making it against the branch. (The e2e tests should hopefully make the impact of the change easy to verify.) If you'd like, I can ping you when the branch is a bit further along– bc right now it's just an overnight proof of concept– but basically I think you'll need to add the behavior you're describing to the adjustLayoutByDelta method.

There are even two tests I had already commented on that you could "fix" with your change. (Search for the string "An alternate layout result might be" in adjustLayoutByDelta.test.ts)

@hipstersmoothie
Copy link
Contributor Author

I'll take a look when I can!

@bvaughn
Copy link
Owner

bvaughn commented Nov 12, 2023

#182 has been merged and I plan to release v56 this afternoon with the changes. I'm closing old issues in light of the rewrite because most of them are no longer relevant. If this issue still occurs with v56, please re-open with an updated description on how to reproduce it.

@bvaughn bvaughn closed this as completed Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants