Skip to content

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

Open
@Gibbo3771

Description

@Gibbo3771

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!).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions