-
Notifications
You must be signed in to change notification settings - Fork 6
feat: draggable bounds #990
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
base: develop
Are you sure you want to change the base?
Conversation
Elessar1802
commented
Dec 19, 2025
- fix: bound movement of draggable to screen
- chore: rm file from eslintignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the DraggableWrapper component to use native bounds constraint from the react-draggable library instead of custom boundary checking logic. The changes improve the positioning system by using screen-absolute coordinates instead of parent-relative positioning, and delegate boundary enforcement to the library's built-in bounds prop.
Key Changes:
- Replaced controlled position state with
defaultPositionand nativeboundsprop for boundary constraints - Refactored position calculations to use screen coordinates instead of parent-relative offsets
- Removed deprecated
layoutFixDeltaparameter from the component API
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| src/Common/DraggableWrapper/types.ts | Removed deprecated layoutFixDelta property from DraggableWrapperProps interface |
| src/Common/DraggableWrapper/DraggableWrapper.tsx | Refactored to use defaultPosition with bounds constraint, simplified position calculations for screen coordinates, and added visibility handling for initial render |
| .eslintignore | Removed DraggableWrapper.tsx from ESLint ignore list to enable linting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.