Closed shipurjan closed 4 weeks ago
Hi @shipurjan,
I am not sure what you mean by "vertical trees". Would you be able to post a screenshot, example or similar?
Great news: even if our optional tree hitbox / indicator does not work for you - you are totally free to use your own hitbox / indicator. Patch package is one way to do that, but you could also fork / copy paste our tree packages and adjust them for your use case
Hi @shipurjan,
I am not sure what you mean by "vertical trees". Would you be able to post a screenshot, example or similar?
Something like this diagram, but rotated 90 degrees. Instead of reorder-above and reorder-below there would be reorder-left and reorder-right (or reorder-before and reorder-after to be direction agnostic)
But I do admit it's probably a niche use case, but being able to fork the package sounds great
The incremental nature of Pragmatic drag and drop let's you use your own pieces, while still being able to use as many shared pieces as you can! 🚀
Hello, it would be great if there was a built-in way for making vertical trees
So that the hitboxes for "reorder above" would be on the left and hitboxes for "reorder below" -- on the right.
https://atlassian.design/components/pragmatic-drag-and-drop/optional-packages/hitbox/about#tree-item
Or another solution would be to add something like
maxDetectionDistance
parameter toattachClosestEdge()
function to allow for detecting the hitbox of the containerEDIT:
For my use case I just patched the hitbox calculating function with
pnpm patch
(the code bellow also in/es2019
and/cjs
directories):And then the drop indicator is hacked like this: