Replies: 2 comments 5 replies
-
Hey @mwdiaz Sorry I didnt have time to dive into the details so if this isnt helpful let me know, but can't the required behavior be accomplished with a combination of defining your own logic in a shouldHandleDrag callback + setting |
Beta Was this translation helpful? Give feedback.
4 replies
-
possible fix released in: 1.10.0 |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Howdy! We have an implementation that essentially wraps the entire page's content in an
<Uploady>
provider that injects a drop zone around all children. The intention being that we'll allow dropping a file anywhere on the page to initiate an upload. The JSX ends up looking something like this (props and specific page content omitted for brevity):which yields a DOM structure that basically matches the JSX:
The
<ModalUploader>
component (which is built using React Aria components) is rendered but initially hidden, and includes auseBatchAddListener()
hook to make itself visible once files are dropped on the page. When the modal is fully rendered and made visible, React Aria will render it in a portal appended to the body:The modal (specifically the underlay) covers the entire page and all future dragover events will bubble up through the overlay, and the drop zone will catch them even though they didn't bubble up through the DOM (due to how events work with React portals). Prior to (I believe v1.3.0) this interaction worked fine, but now that
UploadDropZone
usescontainerElm.contains
to check where the event came from, we can't rely on the prior behavior.For now, I patched around it using
pnpm
to inject an extra check intoisOnTarget
that basically checksif (target?.closest('.underlay'))
and forces Uploady to treat it as on the target. Obviously I don't want to leave this override in place long term, but I was wondering if this sort of use case might be something you would consider supporting longer term, or whether I should just rework the UX a bit to have a drop zone that's contained within the modal itself.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions