[建议] 在 `attachClosestEdge()` 中将 `getBoundingClientRect()` 替换为 `IntersectionObserver`

作者: rose-bouchayer创建于 2026年8月4日更新于 2026年8月4日

在浏览这些包的源代码时,我注意到 attachClosestEdge() 使用了 getBoundingClientRect() 方法。该方法会触发重新布局(也称为布局崩溃),众所周知,这会导致性能瓶颈,而可以通过使用 IntersectionObserver API 来避免。有关此主题的资源,请参阅 什么会引发布局/重新布局避免大型复杂布局和布局崩溃

内容来源: atlassian/pragmatic-drag-and-drop