Behaving as if bounds are set when child is a component? #464
Unanswered
cwrichardson
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Would be nice if you could format and strip the sandbox to its bare minimum. Here I'm struggling to understand the logic since it's polluted with so many external APIs. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
TBH, this may be as simple as a cut-and-paste error; and it certainly may not be a @use-gesture issue, it may be some React re-rendering stacking-order issue, but I'm stumped.
I have a bunch of draggable things on a page,
<ColumnDragCard />
. They're wrapped in a div with a useBind hookWhen a drag event starts, I open a portal attached to the document body with one of these
<ColumnDragCard>
objects in itand I manually update the position of the object in the portal by setting top and left attributes based on the xy response from the hook, inside of a UseLayoutEffect block.
The problem I'm having is, in the return for the main app, if I use one of my
<ColumnDragCard>
components inside of the div with the event handler, then useDrag stops reporting pointer updates when the mouse moves outside of the div. BUT, if I manually put (what I believe to be the exact same code) inline in the div with the hook, everything works fine.Here are examples of it working and not working in codesandbox:
Inline objects (works fine)
Component (appears to be trapped by a bound)
Any help in figuring out what I'm doing wrong here would be much appreciated!
TIA
Beta Was this translation helpful? Give feedback.
All reactions