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

Dynamic minimum and maximum size when resizing does not work #100

Open
Gibbo3771 opened this issue Sep 2, 2021 · 3 comments
Open

Dynamic minimum and maximum size when resizing does not work #100

Gibbo3771 opened this issue Sep 2, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@Gibbo3771
Copy link
Contributor

Gibbo3771 commented Sep 2, 2021

Describe the bug
I am trying to use a dynamic resize on a left and right resizable that have a fill wedged in the middle. The issue is that when the space is resizing, the maximun and minimum sizes is captured on resize start. Right now, I have to stop resizing, once I can see it should stop, then drag and it will snap to it's maximum.

To Reproduce
This is quite difficult to reproduce, as I have some extra features in my fork that allow access to the space wrapper from the outside.

I am basically measuring the size of a <Viewport />, <LeftResizable />, <RightResizable /> and <Fill />. If <Fill /> width goes below 25px I then take the viewport width and set a left and right maximum by doing the following:

if (fillWrapperDimensions.width > 50) {
            setLeftMaxSize(undefined);
            setRightMaxSize(undefined);
            return;
        };
	setLeftMaxSize(
		wrapperElementDimensions.width - rightWrapperDimensions.width
	);
	setRightMaxSize(
		wrapperElementDimensions.width - leftWrapperDimensions.width
	);

*WrapperDimensions are basically type Dimension = {width: number, height: number}.

Expected behavior
I expect the Space to cancel resizing if it's maximum value is reached, even if that value is dynamic

Package versions (please complete the following information):

  • React version: [e.g. 17.0.2]
  • React spaces version: latest

I may be reporting this as a bug, but perhaps it could be an enhancement. If you also have any guidance on how to support this, that would be good. I have tried making a few changes to force the space to update when props.maximumSize changes but I believe there is more to it than this (obviously since it doesn't work!).

@aeagle
Copy link
Owner

aeagle commented Nov 5, 2021

Hi @Gibbo3771. I'm going to try to get my resize logic refactor over the line in the next release (to support positional spaces) and then will start to focus on overrall minimum/maximum resizing functionality. There seem to be a lot of related requests regarding this (i.e. #87, #72). Hopefully we will be able to reach a consensus on how to move this forward.

@aeagle aeagle added the enhancement New feature or request label Nov 5, 2021
@Gibbo3771
Copy link
Contributor Author

@aeagle Sounds good. Is there a WIP branch for the next release? I would be interested in tracking the progress :).

@aeagle
Copy link
Owner

aeagle commented Nov 9, 2021

@Gibbo3771 Sure thing. There is a release/v0.3 branch and the main functionally I am preparing for it is on feature/resize-handles

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

No branches or pull requests

2 participants