bounding doesn't work properly if using offset

Open
#506 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, react
Domain
frontend

Research direction

The issue names no files, tests, or entry points. Start by reproducing the described draggable component behavior with default position, offset, and bounds, then trace how bounds are calculated. Done means bounds reflect the combined default and offset position while the component remains draggable.

Written by the indexing model from the issue text.

Description

I'm not sure if this is intended behavior, but I might work on a fix. Here's what I'm trying to do:

I want to make my draggable frame responsive, specifically when a user flips a mobile phone between portrait/ landscape, I want the position to readjust. Default position seems to be static once the component is created, so passing a new default prop doesn't change its position. Using position{} works, but I still want the component to be draggable, not controlled. I found a way to get this to work by passing an offset{}, but then the bounding responds to the default position, not the offset+default.

in short, I think the bounding should be calculated based on default + offset position? Any thoughts are appreciated.

Dominant language
JavaScript
Stars
9.3k
Forks
1k
Avg merge
3d 8h
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from react-grid-layout/react-draggable

All issues in react-grid-layout/react-draggable

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.