Skip to content
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

Reordering Tasks in Focus Doesn't Always Work #154

Closed
mt-xing opened this issue Mar 9, 2019 · 5 comments · Fixed by #173
Closed

Reordering Tasks in Focus Doesn't Always Work #154

mt-xing opened this issue Mar 9, 2019 · 5 comments · Fixed by #173
Assignees
Labels
bug Something isn't working frontend Frontend Related
Milestone

Comments

@mt-xing
Copy link
Member

mt-xing commented Mar 9, 2019

Around 90% of the time, reordering a task in focus view by clicking and dragging just results in the task snapping immediately back to where it was. It'll take about a dozen tries before the task actually stays where it was dropped.

@mt-xing mt-xing added the bug Something isn't working label Mar 9, 2019
@SamChou19815
Copy link
Contributor

There is an easy way to reproduce this:

  1. Setup two tasks in the focus view
  2. Try to drag the first task to the bottom of the task view.
  3. The task will bounce back.

A potential solution is to make the droppable section bigger.

@SamChou19815
Copy link
Contributor

SamChou19815 commented Mar 9, 2019

Setting the droppable's css to be height: 100% seems to fix the problem I mentioned above. (A potential fix is in the #158 branch) @mt-xing can you confirm whether it's the only problem?

@SamChou19815 SamChou19815 self-assigned this Mar 10, 2019
@mt-xing
Copy link
Member Author

mt-xing commented Mar 10, 2019

That's strange. I've been entirely unable to reproduce the bug at all in either of our development branches - neither master nor the experimental typescript branch. It's very prevalent on samwise.today though. Here's a video: https://youtu.be/UrPOpAIC8Ig

@SamChou19815
Copy link
Contributor

That's strange. I've been entirely unable to reproduce the bug at all in either of our development branches - neither master nor the experimental typescript branch. It's very prevalent on samwise.today though. Here's a video: https://youtu.be/UrPOpAIC8Ig

@mt-xing I was unable to reproduce the problem on my machine. But I do notice that there will be a little trouble to drag and drop when the focus view's visible parts cannot show 2 tasks.

@SamChou19815
Copy link
Contributor

SamChou19815 commented Mar 13, 2019

I believe I understand the root cause.
Suppose we have T1 (focused), T2 (not focused), T3 (focused) in this order.
Current implementation will pass all the tasks to the focus view, and the a task component inside the focus view decides whether to render or return null.
Therefore, this kind of virtual DOM may be rendered:

return (
  <div>
    <FocusedTask key="1" />
    {null}
    <FocusedTask key="3" />
  </div>
);

This solution may work for any other circumstances, but not for drag-and-drop, at least for the current framework, because the presence of null inside the virtual DOM may affect the drop position calculation. I'm going to fix this when I'm implementing the separation of completed task and uncompleted task in focus view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend Frontend Related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants