React-virtualized List 滚动变得疯狂并且 Autosizer 不起作用

React-virtualized List scroll going crazy and Autosizer doesn't work

当我滚动时列表的滚动变得疯狂并且之后它一直在抖动,即使我什么都不做)正如你在这里看到的:https://imgur.com/SdgMf7f(抱歉嵌入 gif 不起作用这里)

我做了一个最小的例子,它发生在:

https://codesandbox.io/s/4r2q3omv1w

我确实将样式传递给了行。

此外,如果您更改列表的高度和宽度以从 Autosizer 获取值,则列表不会出现,即使这看起来与 example.[=13= 中的完全一样]

有什么办法可以解决这两个问题吗?

编辑:它似乎在 Firefox 中运行得更好一些,但在我自己的代码中仍然有点不稳定,而且 codesandbox 的滚动仍然不完美。 (它在 chrome 中超级神经质,即使在隐身模式下也是如此)。

看来这个问题与 2 个问题有关:

  • 不将 heightwidth<AutoSizer> 委托给 <List>

  • 行高被定义为50但实际呈现的高度更-

    From the docs: Note that it is very important that rows do not have vertical overflow. It would make scrolling the list difficult (as individual items will intercept the scroll events)

这是一个工作示例:https://codesandbox.io/s/jppm1mmo83