Open tylercote opened 4 years ago
I think there is a way, but right now it would be very manual for you to implement. Currently the library provides DraxScrollView
which is essentially a ScrollView
which integrates scroll position tracking and drag auto-scroll behavior. It should be possible to do something similarly with SectionList
in your own code, but it would probably be better for us to implement a wrapper or hooks in the library to make that easier.
It's been a while since I worked on that logic, but at my next opportunity (perhaps tomorrow or Thursday evening) I will try to refresh my memory on that logic and share a little more insight here.
Thanks for the quick response. I think it would be definitely useful to a common use case to extend a helper for working with an external ScrollView somehow. Maybe even some way to force a recalculation of drop zone positions (through a ref?).
Any update on this feature? I'm running into a similar issue.. I'm not using SectionList, but the layout of my page can change and any DraxView that is lower on the page than the spot that a change happens registers as being in its old location. My code could easily change to a SectionList if support for section lists existed, but I'd still be resizing sections after the page loads.
I'll start this reply with my standard apology for the state of maintenance of this library right now. Personal circumstances have not afforded me the time to do any deep work on Drax for a while, and I am not fresh on the code. I have a Drax logic documentation project in progress but presently on hold. The goal with that is to make it easier for myself and others to maintain the library without accidentally breaking or changing functionality. I do however keep an eye on the issues and try to answer things off the top of my head if I am able.
Unfortunately I do not have an update, and I am sorry for not yet having the chance to research and share more info as I had hoped in my initial comment. Perhaps @tylercote figured out a solution or workaround without me.
Makes sense @lafiosca ! Thanks for all your work, this is my favorite drag-and-drop library that I could find :)
For anyone facing this in the future, the best I've been able to find:
I've had to use a similar workaround in my non-Drax-related work. I really don't understand why certain things (particularly phone orientation changes) don't always trigger onLayout.
@lafiosca @connor-tyrrell is this package still being maintained?
@bhimeshchauhan Only in the barest sense that I still reply to issues here to answer any questions I'm able, but I have not had time for any active development on this library in quite a while, and no one has reached out with interest in maintaining it. I apologize.
Is there a way for a draggable DraxView to recognize when the layout of my SectionList has changed? It works correctly on load, but once I scroll a bit, the receiving DraxView is incorrect by the offset that I scrolled.