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

A way to derive dragging active state #94

Closed
antonisierakowski opened this issue Jan 22, 2023 · 4 comments · Fixed by #113
Closed

A way to derive dragging active state #94

antonisierakowski opened this issue Jan 22, 2023 · 4 comments · Fixed by #113
Assignees
Labels
enhancement New feature or request

Comments

@antonisierakowski
Copy link

antonisierakowski commented Jan 22, 2023

My specific use case requires me to disable certain app features and hide a few elements while the user is dragging a panel handle to save up on performance, so I need to be able to somehow derive this dragging active state using the library API.
In the library I was going to migrate from I could just pass callbacks that were called whenever the user started or stopped dragging the handles (something like onResizeStart/onResizeEnd).

@bvaughn
Copy link
Owner

bvaughn commented Jan 22, 2023

What’s your motivation for switching away from the library you’re currently using?

@antonisierakowski
Copy link
Author

antonisierakowski commented Jan 23, 2023

To be clear, what I referred to as a 'library' is a set of class-based, non-typescript components that were originally ripped from an actual library and commited (after making some unspecified adjustments to meet the requirements) into the codebase I'm currently contributing to. I'm looking to replace it as it's a general mess and a nightmare to maintain - but so far, out of all the libraries I've tried only this one seems to tick all the boxes - except just this one thing

@bvaughn
Copy link
Owner

bvaughn commented Jan 23, 2023

I think PanelGroup could probably be updated to support an optional start/stop callback prop (not sure about what they'd be named) that could be called from these two places:
https://github.com/bvaughn/react-resizable-panels/blob/dffc160ecf9c917701f3eec043629736b5e2eb8d/packages/react-resizable-panels/src/PanelGroup.ts#L589C7-L607

Note that I don't think it makes senes to try to fire that event for Window Splitter events (resizing by keyboard) because there's no explicit stop for those, nor for imperative resize methods (by React refs) because those are generally discrete– only for resizes done by pointer.

@bvaughn bvaughn added the enhancement New feature or request label Jan 23, 2023
@bvaughn bvaughn self-assigned this Mar 18, 2023
bvaughn added a commit that referenced this issue Mar 18, 2023
@bvaughn
Copy link
Owner

bvaughn commented Mar 18, 2023

Available in v0.0.37

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

Successfully merging a pull request may close this issue.

2 participants