Skip to content

Commit 6d7c2e0

Browse files
committed
feat: 书籍动画优化
1 parent 18f3313 commit 6d7c2e0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/pages/home/BookLibrary/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ export default function BookLibrary() {
332332

333333
// ─── 飞出动画:卡片位置 → 屏幕中心(useLayoutEffect 在 paint 前执行) ───
334334
useLayoutEffect(() => {
335-
if (!dialogOpen || !selectedBook || !flySourceRef.current) return
335+
if (!dialogOpen || !selectedBookRef.current || !flySourceRef.current) return
336336

337337
const contentEl = overlayContentRef.current
338338
const maskEl = maskRef.current
@@ -399,7 +399,7 @@ export default function BookLibrary() {
399399
return () => {
400400
if (openCleanupRef.current) clearTimeout(openCleanupRef.current)
401401
}
402-
}, [dialogOpen, selectedBook])
402+
}, [dialogOpen])
403403

404404
// 执行飞回动画(Phase 2):直接操作 DOM + CSS transition
405405
const doFlyback = () => {

0 commit comments

Comments
 (0)