-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep Draggable on Droppable until some operations are performed #1027
Comments
Is it possible to optimistically perform the async operation and revert the drag if it's not successful? I would think this would be okay for most scenarios. |
@treshugart |
That's sorta what I meant by optimistically performing the async op. I would generally lean towards this unless it's an operation that could have negative effects if reverted later. In terms of digging deeper in this issue, I'd be going beyond my understanding of the internals. Alex, the maintainer, will be back from holiday soon. See #1010 for more details. |
Here are some things you can do @ParthPatwalaTA:
Having the validation service as a third party thing is complicated. Ideally you compute where something can move before the drag even starts - this is what we do in Jira. Does that help @ParthPatwalaTA ? |
@alexreardon I'm trying to build a time tracking App. In this App, let's say you have a week view and you will add time like 10:00-20:00, 11:00-18:00 on a single date-block. So I've added draggable time-blocks with this library to simply drag and drop the time on week's particular date.
At this moment, I want to make a 3rd party call to see if time already exists or not for a particular date. So in that process, time-blocks shift backs to the original position and if there is no error then it moves back to the destination position. @alexreardon can you give any suggestions on this to make this simpler? |
Bug or feature request?
Question
Expected behavior
Keep Draggable component in droppable until operations are performed. Is it possible to do this ? Yes - how can i achieve this?
Actual behavior
Normal Drag and Drop is working fine. Now if we were to add API request or some complex operation, when we drop draggable item, it goes back to original position then comes back on droppable after operation is performed.
What version of
React
are you16.5.2
What version of
react-beautiful-dnd
are you running?10.0.3
What browser are you using?
Chrome
The text was updated successfully, but these errors were encountered: