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

Using the new JS API with ResizeObserver to detect parent resize #330

Open
wants to merge 4 commits into
base: v2
Choose a base branch
from

Conversation

ghazette
Copy link

@ghazette ghazette commented Jan 6, 2022

I had trouble with the parent resize, windows was sometimes dragged outside the parent limits, i am using it in my 3D viewer for the GUI, no problem since i implemented the ResizeObserver

@mauricius
Copy link
Owner

Thank you for the PR!

I've taken a brief look at the implementation, but I don't get the point of the handleParentResize function. Looks like that it works even without it.

@ghazette
Copy link
Author

ghazette commented Jan 31, 2022

handleParentResize update the boundaries when parent container is resized, windows are automatically moved no click action are required on the windows

@HLN177
Copy link

HLN177 commented Nov 9, 2023

I recently encountered the same issue where the draggable component overflows the boundaries of the parent container after the parent is resized. In theory, the dimensions of the parent container shouldn't be altered. If a resize listener is added to the parent component, the draggable component will recalculate its boundary values internally, which could lead to conflicts between the component's coordinates and the boundary values. I think the logic code itself needs to handle this to prevent such occurrences.

@ghazette
Copy link
Author

I recently encountered the same issue where the draggable component overflows the boundaries of the parent container after the parent is resized. In theory, the dimensions of the parent container shouldn't be altered. If a resize listener is added to the parent component, the draggable component will recalculate its boundary values internally, which could lead to conflicts between the component's coordinates and the boundary values. I think the logic code itself needs to handle this to prevent such occurrences.

Did my patch fix this issue for you ?

@HLN177
Copy link

HLN177 commented Jan 29, 2024

I recently encountered the same issue where the draggable component overflows the boundaries of the parent container after the parent is resized. In theory, the dimensions of the parent container shouldn't be altered. If a resize listener is added to the parent component, the draggable component will recalculate its boundary values internally, which could lead to conflicts between the component's coordinates and the boundary values. I think the logic code itself needs to handle this to prevent such occurrences.

Did my patch fix this issue for you ?

Your idea is good. But I finally choose to setup different "key" to force re-render the components while it could re-calculate the boundary when I need.

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

Successfully merging this pull request may close these issues.

None yet

3 participants