MCPcopy Create free account
hub / github.com/xerrors/Yuxi / waitForLayoutStable

Method waitForLayoutStable

web/src/utils/scrollController.js:75–80  ·  view source on GitHub ↗

* 等待 DOM 布局稳定 * @returns {Promise }

()

Source from the content-addressed store, hash-verified

73 * @returns {Promise<void>}
74 */
75 async waitForLayoutStable() {
76 // 使用 requestAnimationFrame 确保 DOM 渲染完成
77 await new Promise((resolve) => requestAnimationFrame(resolve))
78 // 额外等待一小段时间确保 CSS 布局完成
79 await new Promise((resolve) => setTimeout(resolve, 50))
80 }
81
82 /**
83 * 智能滚动到底部

Callers 1

scrollToBottomMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected