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

[BUG] Weird scrolling behavior with react-beautiful-dnd #426

Closed
loun4 opened this issue Aug 4, 2021 · 9 comments
Closed

[BUG] Weird scrolling behavior with react-beautiful-dnd #426

loun4 opened this issue Aug 4, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@loun4
Copy link

loun4 commented Aug 4, 2021

Describe the bug
Dragging items to the bottom of the list causes strange scrolling behavior

Reproduction
https://codesandbox.io/s/react-virutoso-with-react-beautiful-dnd-forked-pslfr?file=/src/index.js

Screenshots

dnd-scroll.mov

Desktop (please complete the following information):

  • OS: Mac OS 11.5.1.
  • Browser: Browser Chrome 92
@loun4 loun4 added the bug Something isn't working label Aug 4, 2021
@loun4
Copy link
Author

loun4 commented Aug 10, 2021

Any suggestion or workaround to fix that ?

@petyosi
Copy link
Owner

petyosi commented Aug 10, 2021

I think the problem lies somewhere in the sample itself (rather than the library), probably the way the placeholder is calculated.

@loun4
Copy link
Author

loun4 commented Aug 17, 2021

Another sample based on the official one (https://virtuoso.dev/react-beautiful-dnd/) :
https://codesandbox.io/s/react-virutoso-with-react-beautiful-dnd-bug-wgtmq?file=/src/index.js

We don't understand why this only happens when items are dragged to the bottom.

dnd.mov

@petyosi
Copy link
Owner

petyosi commented Aug 17, 2021

Feel free to examine the DOM structure and see what causes the flickering. I am unlikely to get to debugging that anytime soon.

@Guiw5
Copy link

Guiw5 commented Oct 11, 2021

have you tried adding an extra height to those container divs?

@Harshit369
Copy link

@loun4 were you able to control it somehow? it only happens when you drag something to the end of any other column. doesn't happen in the same one.

@OleksandrEmpeek
Copy link

I had this problem too, the solution for me was to add {provided.placeholder} to the end of the Droppable container

<Droppable droppableId={`${status.Id}`}>
  {provided => {
    const columnFind = columns.find(column => column.statusId === status.Id);

    return (
      <div
        ref={provided.innerRef}
        className={classNames(styles.tasksList, {
          [styles.emptyColumn]: !columnFind?.tasks.length,
        })}
        {...provided.droppableProps}
      >
        {buildTasks(columnFind)}
        {provided.placeholder}
      </div>
    );
  }}
</Droppable>

@petyosi petyosi closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2022
@Aditi0505
Copy link

Aditi0505 commented Nov 1, 2023

Hey, any solution to this? It is only happening for the bottom most element. My hunch is since the virtual list has it as the last element, it is unable to remove the top item and change indexes accordingly and css transition is not applied. Can someone please help?

PS: I tired using provided.placeholder but apparently, virtual lists doesn't require one.

@zhangxuanou
Copy link

嘿嘿,这个问题有什么解决办法吗?它只发生在最底部的元素上。我的预感是,由于虚拟列表将其作为最后一个元素,因此无法删除顶部项目并相应地更改索引,并且不应用 css转换。有人可以帮忙吗?

PS:我厌倦了使用provided.placeholder,但显然,虚拟列表不需要它。

I want to ask if you have solved this problem?

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

No branches or pull requests

7 participants